-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: scripting.executeScript
without specifying tabId
#91
Comments
scripting.executeScript
without specifying tabId
As discussed during the 2021-11-11 meeting, this can be tricky as of right now frameId is not unique in all contexts. A potential alternative proposal was to use a window object. You can think about a syntax like this:
|
As with #12 (comment) With the introduction of documentId this seems to become possible. |
We discussed this at the WECG meet-up. We're agreed that this is useful functionality. There's one tricky bit, which is that currently, the main frame is always We tentatively agred that we're supportive of:
This would also allow extensions to inject in non-tab contexts, as @carlosjeurissen mentioned in the issue report. We also pointed out that this does introduce a requirement that non-main-frame IDs are globally unique. This is already an attribute in most Chromium-based browsers, Firefox, and Safari, but is now a requirement for this functionality. |
Filed https://bugzilla.mozilla.org/show_bug.cgi?id=1891480 to track this at the Firefox side. |
Background
scripting.executeScript
/tabs.executeScript
require one to define the tabId of the main_frame or sub_frame to inject the content script in.Proposal
Allow to only specify a
frameId
as target when runningscripting.executeScript
/tabs.executeScript
. This basically means eithertabId
orframeId
will be required when runningexecuteScript
orinsertCSS
.Reasoning
This will allow dynamic contentscript to be injected into frames within non-tab environments like extension popups, and to allow injection of script when it's faster / more convenient to not specify a tabId.
Requirement
All frameIds should be unique for this to be implemented. See:
The text was updated successfully, but these errors were encountered: