Closed Bug 665281 Opened 13 years ago Closed 13 years ago

Unnecessary content script proxies when document has system principal

Categories

(Add-on SDK Graveyard :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ochameau, Assigned: ochameau)

Details

Attachments

(1 file)

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().
Attached patch FixSplinter Review
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+
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
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: