Optionally allow a content script registered using contentScripts.register to be injected on existing tabs that matches
Categories
(WebExtensions :: General, enhancement, P5)
Tracking
(Not tracked)
People
(Reporter: rpl, Unassigned)
References
Details
When content scripts are specified in the manifest.json file and the extension is installed, its content scripts are injected in the existing tabs that they match, on the contrary content scripts registered programmatically using contentScripts.register are only going to be executed in the existing tabs on the next page loads that they match. It seems reasonable to support this behavior on the contentScripts.register API, eventually based on an additional options, e.g. `includeExisting: true`.
Comment 1•6 years ago
|
||
Such a flag could also be useful for the manifest-declared content_scripts.
Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 2•5 years ago
|
||
ISTM that scripts could be injected by other mechanisms by the extension, so lowering priority.
Updated•2 years ago
|
Reporter | ||
Comment 3•3 months ago
|
||
The contentScripts (and Firefox-only) API namespace has been deprecated for MV3 extensions and replaced by a new scripting API namespace we share with other browser vendors (and available to both MV2 and MV3 extensions). The new scripting API namespace also supports a registerContentScripts method that similarly to the contentScripts API does not inject the content scripts registered into existing tabs, but the same namespace provides an executeScript method that complement the registerContentScript method and allows to workaround the use case on the extensions side and so I'm going to lower the priority further and set it to P5.
In addition to that I'm removing the seealso link to Bug 1595853, because that was a meta tracking followups related to the userScripts firefox-only API namespace which has been already deprecated for MV3 extensions.
Description
•