scripting.executeScript should not execute in all frames by default
Categories
(WebExtensions :: General, defect, P2)
Tracking
(firefox-esr91 unaffected, firefox96 unaffected, firefox97 unaffected, firefox98 fixed)
Tracking | Status | |
---|---|---|
firefox-esr91 | --- | unaffected |
firefox96 | --- | unaffected |
firefox97 | --- | unaffected |
firefox98 | --- | fixed |
People
(Reporter: robwu, Assigned: willdurand)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [addons-jira])
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
The scripting.executeScript
implementation does currently not default to frameIds = [0];
at https://searchfox.org/mozilla-central/rev/02bd3e02b72d431f2c600a7328697a521f87d9b6/toolkit/components/extensions/parent/ext-scripting.js#75-79
That specific logic should be equivalent to https://searchfox.org/mozilla-central/rev/02bd3e02b72d431f2c600a7328697a521f87d9b6/toolkit/components/extensions/parent/ext-tabs-base.js#799-805.
The consequence of this missing check is that scripting.executeScript({ target: { tabId }, ...})
injects in all frames by default because of https://searchfox.org/mozilla-central/rev/02bd3e02b72d431f2c600a7328697a521f87d9b6/toolkit/components/extensions/parent/ext-tabs-base.js#700
Together with a fix, this consequence should be documented more explicitly at https://searchfox.org/mozilla-central/rev/02bd3e02b72d431f2c600a7328697a521f87d9b6/toolkit/components/extensions/parent/ext-tabs-base.js#684.
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Reporter | ||
Comment 2•3 years ago
|
||
The script does not actually run in all frames because the implementation requires frameId to be set, allFrames true, or only injects in the top frame: https://searchfox.org/mozilla-central/rev/7fb9750a14e99267a77328559c2fd022e360d99b/toolkit/components/extensions/WebExtensionPolicy.cpp#696-705.
Assignee | ||
Comment 3•3 years ago
|
||
I attached a patch to fix the logic issue in parent/ext-scripting.js
anyway and added test coverage.
Assignee | ||
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Set release status flags based on info from the regressing bug 1736574
Updated•3 years ago
|
Comment 6•3 years ago
|
||
bugherder |
Description
•