Open Bug 1458947 Opened 6 years ago Updated 3 months ago

Optionally allow a content script registered using contentScripts.register to be injected on existing tabs that matches

Categories

(WebExtensions :: General, enhancement, P5)

60 Branch
enhancement

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`.
See Also: → 1437098
Such a flag could also be useful for the manifest-declared content_scripts.
Priority: -- → P2
Product: Toolkit → WebExtensions

ISTM that scripts could be injected by other mechanisms by the extension, so lowering priority.

Priority: P2 → P3
See Also: → 1595853
See Also: → 1516478
Severity: normal → S3

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.

Severity: S3 → N/A
Priority: P3 → P5
See Also: 1595853
You need to log in before you can comment on or make changes to this bug.