Discuss: scripting.registerContentScripts()
when there are no host permissions
#356
Labels
discussion
Needs further discussion
opposed: chrome
Opposed by Chrome
opposed: firefox
Opposed by Firefox
opposed: safari
Opposed by Safari
Chrome, Firefox and Safari(>= 16.4) supports dynamic content script, i.e.
scripting.registerContentScripts()
.At present, if an extension doesn't have related host permissions,
scripting.registerContentScripts()
runs without error, andscripting.getRegisteredContentScripts()
can get the registered info. But in fact, the registered content scripts don't run in the matched websites. From an ergonomic point of view, this is a bit counterintuitive.So, I have a few suggestions for
registerContentScripts()
. Similar toidentity.getAuthToken()
, add an option parameter for requesting the host permission, and return whether it is registered successful.This suggestion is only to improve the developer experience. It can be workaround by calling
permissions.contains()/request()
beforescripting.registerContentScripts()
.The text was updated successfully, but these errors were encountered: