Closed Bug 1454342 Opened 6 years ago Closed 2 years ago

executeScript error: frameId and allFrames are mutually exclusive


(WebExtensions :: Compatibility, defect, P5)

60 Branch


(Not tracked)



(Reporter: eight04, Assigned: robwu)


(Blocks 1 open bug)


(Keywords: dev-doc-complete)

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 (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. ...

I also found a ticket related to this issue, which is under the documentation category:
This is not a bug. frameId and allFrames are mutually exclusive.

The documentation should be fixed, though.
Closed: 6 years ago
Resolution: --- → INVALID
Product: Toolkit → WebExtensions
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.
Ever confirmed: true
Resolution: DUPLICATE → ---
Note: The other bug has STR that QA can use to verify this bug:

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

tabs.executeScript is part of MV2.

Its successor, scripting.executeScript explicitly marks the allFrames and frameIds as a mutually exclusive:

"You cannot specify both the frameIds and allFrames properties."

This is being implemented in bug 1736574.

The mutual exclusiveness of allFrames and frameIds is already documented at

allFrames Optional
If true and frameId is set, then it will raise an error. (frameId and allFrames are mutually exclusive.)

Closed: 6 years ago2 years ago
Resolution: --- → WONTFIX
See Also: → 1736574
You need to log in before you can comment on or make changes to this bug.