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().
Created attachment 540232 [details] [diff] [review] Fix Low risk fix with comments.
Assignee: nobody → poirot.alex
Attachment #540232 - Flags: review?(myk)
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
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.