Skip to content

Commit

Permalink
Workaround for a bug that causes the Security Manager to veto the use…
Browse files Browse the repository at this point in the history
… of eval. Fixes greasemonkey#1258
  • Loading branch information
sizzlemctwizzle authored and arantius committed Jan 24, 2011
1 parent 5bcb9f3 commit 6a4ffd5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/greasemonkey.js
Expand Up @@ -297,7 +297,11 @@ GM_GreasemonkeyService.prototype = {
"registerMenuCommand",
unsafeContentWin);

sandbox.__proto__ = wrappedContentWin;
// Re-wrap the window before assigning it to the sandbox.__proto__
// This is a workaround for a bug in which the Security Manager
// vetoes the use of eval.
sandbox.__proto__ = new XPCNativeWrapper(unsafeContentWin);

Components.utils.evalInSandbox(
"var document = window.document;", sandbox);

Expand Down

0 comments on commit 6a4ffd5

Please sign in to comment.