Webextension implementing host permissions

Hi!
Which is the proper way to implement permissions of using my addon based on hosts/URLS?
Before I was used nsIPermissionManager, but now it is not accessible from background scripts.
Webextension permissions API manage only specific list of optional_permissions where I can’t add my addon specific functionality (for example printing).
Only option I can see now is to implement custom permission implementation using browser.storage to be persistent and my own logic and user interface to request/check/grant/reject.
If this is only case are there any good implementations to point them?

Regards,

Dimitar Angelov

Hi,

What permissions are you looking to add? You can’t print from a WebExtension yet. There’s a bug for a print preview API. What permissions do you need?

Only option I can see now is to implement custom permission implementation using browser.storage to be persistent and my own logic and user interface to request/check/grant/reject.

I don’t understand. WebExtensions don’t have access to the entire system like legacy extensions. How are you going to implement custom permissions in a WebExtension? It’s not going to work, but then again I don’t really understand what you’re trying to do

Hi,
I’m working on webextension-experiment which implement print services (not only Print Preview and SavePDF). This API is needed to port addon jsPrintSetup.
jsPrintSetup provide extended printing functionalities for client side javascript.
When client side javascript is trying to access jsPrintSetup approvement from user is needed for that particular host may use these print services.
In short jsPrintSetup have to implement host based access control to its API.
The my idea was to use Permissions API to maintain list of allowed/blocked hosts.
I’ve found that is possible to implement host permission using only origins property of request.
But when user denied/blocked request there is no information that particular host is blocked.
Are there any good practice to implement host based access control to addon functionality?