I'm using Cu.evalInSandbox in a bootstrapped extension to run code in an 
isolated environment using a content window as the sandbox prototype. When the 
code adds expando properties to the window (e.g. jQuery), the sandbox 
predictably leaks when the extension is disabled.

I assume that the sandbox gets an Xray wrapper for the window that is specially 
created for it. What is the best way to remove all expando properties added in 
the sandbox or otherwise destroy this wrapper when the extension is disabled? 
The best idea I'm having is to set wantXrays to false when creating the sandbox 
and pass in my own wrapper using Object.create(window). That way I can iterate 
over the wrapper when I want to free the sandbox and null out any own 
properties.

Does that make sense or is there a cleverer way I'm missing?
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to