Stop using JS proxies for content scripts

RESOLVED FIXED in 1.11

Status

Add-on SDK
General
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: ochameau, Assigned: ochameau)

Tracking

unspecified
1.11
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Thanks to recent landing of bug 738244, we will be able to stop using JS proxies for content scripts. These proxies were used to workaround various bugs/limitations of xraywrappers.

Here is following changesets we will rely on:
https://bugzilla.mozilla.org/show_bug.cgi?id=738244#c55
https://bugzilla.mozilla.org/show_bug.cgi?id=763897#c24
For the docs, I guess we will just remove this:
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/api-utils/content/proxy.html

For this page: https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/guides/content-scripts/accessing-the-dom.html, it looks to me like we can make fairly minor changes. For example, instead of "To deal with this, content scripts access DOM objects via a proxy....The proxy is based on XRayWrapper, (also known as XPCNativeWrapper)" we could just say "content scripts access DOM objects using XRayWrapper" and refer to it as a "wrapper" rather than a proxy. Does that sound right to you? There aren't any more significant changes in that section, that result from this change?
Created attachment 656895 [details]
Pull request 543
Assignee: nobody → poirot.alex
Attachment #656895 - Flags: review?(dtownsend+bugmail)

Comment 3

5 years ago
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/ed1db71f34227c09b5e6934f337cb0aa49b27243
Bug 786976: Stop using JS proxies starting with FF17.

https://github.com/mozilla/addon-sdk/commit/bc7b29292549926ff26a1cc5df4fe36bfc9861bc
Merge pull request #543 from ochameau/remove-content-proxy

Fixes Bug 786976: Stop using JS proxies starting with FF17.

Updated

5 years ago
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Attachment #656895 - Flags: review?(dtownsend+bugmail) → review+
Target Milestone: --- → 1.11
(In reply to Will Bamberg [:wbamberg] from comment #1)
> For the docs, I guess we will just remove this:
> https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/api-
> utils/content/proxy.html

We are still using proxies for FF <17. So the proxy module is still here until we decide to stop supporting FF<17. Might be worth keeping this doc? But I'm not really against removing it.

> 
> For this page:
> https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/guides/
> content-scripts/accessing-the-dom.html, it looks to me like we can make
> fairly minor changes. For example, instead of "To deal with this, content
> scripts access DOM objects via a proxy....The proxy is based on XRayWrapper,
> (also known as XPCNativeWrapper)" we could just say "content scripts access
> DOM objects using XRayWrapper" and refer to it as a "wrapper" rather than a
> proxy. Does that sound right to you? There aren't any more significant
> changes in that section, that result from this change?

Sounds good. There shouldn't be any significant difference. There is two thought:
1/ bug 787013: Some methods are missing on all JS objects. But we were already missing all of those, except `valueOf`.
2/ Some subtle modification when you listen to `message` event, event.source was refering to unexpected window. But I'm not expecting anyone will suffer from this.

And a final note about bug 787070. We were already having this issue when using JS proxies and it will still be the case with xraywrappers. It might be worth documenting it as we have to manually patch one line of prototype.js in order to make it work in content scripts.
Blocks: 799961
You need to log in before you can comment on or make changes to this bug.