Unnecessary content script proxies when document has system principal

RESOLVED FIXED in 1.1

Status

P2
normal
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: ochameau, Assigned: ochameau)

Tracking

unspecified

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
I faced this bug recently while working with chrome-mod.
I don't think we can reproduce this bug easily using only high level APIs.

The problem is about content script proxies created even if the target document has system principal. When we use a Worker on such document, XPCNativeWrapper(window) === window! And because of this, Proxies become useless as they need this wrapper to hold a different set of attributes.
Finally as proxies code expect a wrappedJSObject attribute, we got exceptions.

In chrome-mod, I'm using Worker on chrome documents.
There may be some problem when using chrome urls in panels or when a user load a chrome document in a tab and a developer do tab.attach().
(Assignee)

Comment 1

7 years ago
Created attachment 540232 [details] [diff] [review]
Fix

Low risk fix with comments.
Assignee: nobody → poirot.alex
Attachment #540232 - Flags: review?(myk)
Priority: -- → P2
Target Milestone: --- → 1.1
Comment on attachment 540232 [details] [diff] [review]
Fix

Looks good.  I wouldn't mind a test here, but my primary concern is testing the case where we do want the proxy, and the existing proxy tests should be doing that.
Attachment #540232 - Flags: review?(myk) → review+
(Assignee)

Comment 3

7 years ago
Landed with additional unit tests that check wrapped access with "content documents" and unwrapped one with "chrome documents":
https://github.com/mozilla/addon-sdk/commit/5c5ea9505a13732cfb3fc87b715795a603aabce9
(Assignee)

Updated

7 years ago
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.