Closed Bug 1603473 Opened 6 years ago Closed 6 years ago

'Report Site Issue' doesn't work with Fission enabled

Categories

(Web Compatibility :: Tooling & Investigations, defect, P2)

defect

Tracking

(firefox77 fixed)

RESOLVED FIXED
Tracking Status
firefox77 --- fixed

People

(Reporter: neha, Assigned: twisniewski)

Details

(Whiteboard: [fission:m5])

Attachments

(1 file)

Trying to report site issue with Fission enabled does not work. It fails with the error:
"SecurityError: Permission denied to access property "windowUtils" on cross-origin object"

Fission Milestone: --- → M5
Priority: -- → P3
Fission Milestone: M5 → ---
Component: DOM: Core & HTML → Tooling & Investigations
Product: Core → Web Compatibility

Yeah, we should probably fix this soon. Neha, are there pointers to similar types of bugs that have been fixed or guides we can use? Thanks

Flags: needinfo?(nkochar)
Priority: P3 → P2

I can't point you to any similar issues, but I can tell you the general problem and solution. The code here walks the entire frame tree for a tab trying to gather inner window IDs:

https://searchfox.org/mozilla-central/rev/923eec8d2fb8078ebc7a33a9e1ce73eac01f7446/browser/extensions/report-site-issue/experimentalAPIs/tabExtras.js#25-35

However, when one of those frames is out-of-process, you don't have a real window object, only a remote window proxy, with limited functionality. That proxy isn't allowed to know any more about the window than a cross-origin website would, so it doesn't know its inner window ID.

The solution is probably to walk the entire browsing context tree for the tab in the parent process (calling .getChildren() on each the same way you currently traverse window.frames), get .currentWindowGlobal.innerWindowID from each, and then collect the console messages in the parent process rather than the child.

Flags: needinfo?(nkochar)

That said, if you want to continue doing the kind of processing on the console messages that you currently do, you're going to need to create a JSWindowActor that processes just the messages for the window it's tied to in the content process, and then in the parent, send a separate query to the actor for the current window global of each BrowsingContext, rather than just collecting the logging in the parent.

Thanks, Kris.

Tracking for Fission dogfooding (M5)

Whiteboard: [fission:m5]

I notice this problem today on mail.google.com in regular (non-fission) Nightly. Report Site Issue works in all other tabs, just not in my pinned gmail tabs. Full messages below:
SecurityError: Permission denied to access property "windowUtils" on cross-origin object data:function getInfoFrameScript(messageName) { /* eslint-env mozilla/frame-script:16
SecurityError: Permission denied to access property "windowUtils" on cross-origin object data:function getInfoFrameScript(messageName) { /* eslint-env mozilla/frame-script:16

modify report-site-issue to use a JSWindowActorChild to gather tab info

Assignee: nobody → twisniewski
Status: NEW → ASSIGNED

@Panos, I see the same error, but it seems to go away with the patch I just attached.

Tom, what's the status here?

Flags: needinfo?(twisniewski)

This is stuck waiting for review. kmag, any chance you could take a look, since you're the one who suggested this solution in comments 2 and 3?

Flags: needinfo?(twisniewski) → needinfo?(kmaglione+bmo)
Pushed by twisniewski@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4b48944ac353 modify report-site-issue to use a JSWindowActorChild to gather tab info; r=kmag,webcompat-reviewers,denschub
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Flags: needinfo?(kmaglione+bmo)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: