On Wednesday, April 17, 2013 3:57:58 PM UTC+2, Bobby Holley wrote:
> When you want the sandbox to die, you can do
> |Components.utils.nukeSandbox(sandbox)|, and it'll go away. Simple as that.
> 
> :-)

Awesome, exactly what I was looking for! I'm not sure how I missed that (would 
be good to reference it from 
https://developer.mozilla.org/en-US/docs/Components.utils.Sandbox although I 
really should have found it anyway).

> > 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.

> That is indeed clever, but has the potential to break a lot of the special
> handling we do to make |this|-bindings work properly in conjunction with
> sandboxPrototype. This stuff already pushes the boundaries a little bit, so
> I'd shy away of clever tricks like that lest they end up being broken down
> the line.

Yeah, I played around with this a bit today, and it seems problematic from a 
number of perspectives. Apart from anything else, the wrapper serializes as 
"[object Object]" and would probably cause issues with code that is expecting a 
window.

Thanks for your help. I'm trying out nukeSandbox now.

Matt
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to