Closed Bug 1580699 Opened 5 years ago Closed 4 years ago

With Fission enabled "WebDriver:SwitchToFrame" raises: SecurityError: Permission denied to access property "frameElement" on cross-origin object

Categories

(Remote Protocol :: Marionette, defect, P3)

Version 3
defect

Tracking

(Fission Milestone:M7, firefox84 fixed)

RESOLVED FIXED
84 Branch
Fission Milestone M7
Tracking Status
firefox84 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [marionette-fission-mvp])

As noticed on bug 1580692 the WebDriver:SwitchToFrame command is broken under Fission. The following error gets raised:

JavaScript error: chrome://marionette/content/listener.js, line 1542: SecurityError: Permission denied to access property "frameElement" on cross-origin object

Here the source code:

https://searchfox.org/mozilla-central/rev/a777ff11b6d700a698c61e5bd17e73b044304494/testing/marionette/listener.js#1542

It means we cannot directly access frameElement here.

I assume this would need actors in each frame, and to do the comparison in the parent process?

Mike, if you could give a hint that would be great. Thanks!

Flags: needinfo?(mconley)
Priority: -- → P3

Yeesh, sorry for the delay getting back to this. My needinfo stack is too high. :(

So yes, with Fission enabled, you'll not be able to access properties like the frameElement on third-party iframes. I actually think that might be true even today without Fission - evaluating window.frames[1].frameElement from the console at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe throws the same exception.

What you might be able to do is get access to the BrowsingContext of the frame you're interested in, and then send a message to that BrowsingContext's parent. That parent should be able to access the frameElement by accessing .embedderElement on it, which should return the <iframe>, assuming that that DOM node exists in the process running that.

Flags: needinfo?(mconley)

Tentatively moving all bugs whose summaries mention "Fission" (or other Fission-related keywords) but are not assigned to a Fission Milestone to the "?" triage milestone.

This will generate a lot of bugmail, so you can filter your bugmail for the following UUID and delete them en masse:

0ee3c76a-bc79-4eb2-8d12-05dc0b68e732

Fission Milestone: --- → ?

Tracking for Fission milestone M6 because we want to be able to run Marionette tests with Fission before enabling in Nightly.

Fission Milestone: ? → M6
Blocks: WPT-Fis

Looks like we have to replace outerWindowId with browsingContext.id first, before we can work on this bug.

Depends on: 1519335

Tracking WPT Fission bugs for Fission M6b (Q2)

Fission Milestone: M6 → M6b

Note that the wdspec cross-origin tests for switchToFrame are the only tests I could find that exercise WebDriver/Marionette cross-origin behaviour.

This is definitely Fission beta blocking.

Fission Milestone: M6b → M7

This will be fixed with bug 1654628 when the command gets executed with the JSWindowActor implementation. But even then it will be put behind the preference marionette.actors.enabled for the time being. Once the implementation is stable, it will be enabled by default.

Depends on: 1654628

The remaining warning is all related to page navigation and should be fixed by bug 1612831.

Depends on: 1612831
Whiteboard: [marionette-fission-mvp]
Depends on: 1660168
No longer depends on: 1612831
Depends on: 1612831
No longer depends on: 1660168

So to get rid of this it finally needs bug 1660168, which is enabling the usage of the JSWindowActor by default for Fission builds.

Depends on: 1660168
No longer depends on: 1660168
Depends on: 1669169

With the patch on bug 1660168 the test is no longer failing.

Depends on: 1660168
No longer depends on: 1669169

Now with turned on actor usage in Marionette for Fission this is no longer a problem. As such marking as fixed.

Assignee: nobody → hskupin
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.