Boris Zbarsky wrote:
> John J. Barton wrote:
>> I have to say that I would have a hard time predicting what this is 
>> supposed to do. What it did in FF2 was eval source in the context of 
>> the window referenced by win.
> 
> Ah, ok.  Yeah, that would break with the async javascript:, and the 
> author wouldn't notice that it'd also break in other browsers because 
> this is Firefox...
> 
> Sandbox sounds like a good approach.
> 
> -Boris
> 
Looks like evalInSandbox() works.  It wasn't quite how we thought at 
first.  To inject code into a window refed by "win", you first have to 
put that ref into the sandbox, the evalInSandbox() text that uses the 
variable "win":
  var sandbox = new Components.utils.Sandbox(win.location.href);
  sandbox.win = win;
  Components.utils.evalInSandbox(text, sandbox);
John.
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network

Reply via email to