executeScript error: frameId and allFrames are mutually exclusive

REOPENED
Assigned to

Status

defect
P5
normal
REOPENED
Last year
10 months ago

People

(Reporter: eight04, Assigned: robwu)

Tracking

(Blocks 1 bug)

60 Branch
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0
Build ID: 20180412172954

Steps to reproduce:

I encountered this bug while developing an extension:

1. Create a webextension.
2. From the background page, call `executeScript` with `frameId` and `allFrames` arguments at the same time.

I also made a demo repo:

1. Clone https://github.com/eight04/webextension-test. (The executable path inside package.json probably has to be modified.)
2. Run command `npm install && npm start`. It installs web-ext and launches the browser.
3. Open the addon debugger and the error is shown.


Actual results:

The promise returned by executeScript is rejected with the following error:
Error: 'frameId' and 'allFrames' are mutually exclusive



Expected results:

Quote from MDN:

> allFrames Optional
> ... If true and frameId is set, then the code will be injected into the specified frame and all its child frames. ...

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/executeScript#Parameters

I also found a ticket related to this issue, which is under the documentation category:
https://bugzilla.mozilla.org/show_bug.cgi?id=1346941
This is not a bug. frameId and allFrames are mutually exclusive.

The documentation should be fixed, though.
Status: UNCONFIRMED → RESOLVED
Closed: Last year
Resolution: --- → INVALID
Product: Toolkit → WebExtensions
Duplicate of this bug: 1346941
I have re-opened the other bug because it is older and has a test case for QA, and will mark this as a duplicate against that other bug.
Resolution: INVALID → DUPLICATE
Duplicate of bug: 1346941
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: DUPLICATE → ---
Duplicate of this bug: 1346941
Note: The other bug has STR that QA can use to verify this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1346941#c1


We decided to re-open this bug because this restriction is an unnecessary difference in compatibility with the behavior of Chrome's tabs.executeScript API.
Assignee: nobody → rob
Component: Untriaged → Compatibility
I'm holding off the implementation until the refactor in bug 1484373 has landed and sticks.
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.