1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-08 03:44:14 +01:00

Use sandboxes for all JS contexts, to fix breakage, now that we have CPG anyway.

--HG--
extra : rebase_source : 0eb9d8c6a8ee533d6e12d71372554163f9479cf2
This commit is contained in:
Kris Maglione
2014-02-16 13:49:49 -08:00
parent 047cc83641
commit f511ceec40
4 changed files with 8 additions and 10 deletions

View File

@@ -132,17 +132,15 @@ var Modules = function Modules(window) {
if (normal)
return create(proto);
if (services.has("dactyl") && services.dactyl.createGlobal)
var sandbox = services.dactyl.createGlobal();
else
sandbox = Components.utils.Sandbox(window, { sandboxPrototype: proto || modules,
sandboxName: name || ("Dactyl Sandbox " + ++_id),
wantXrays: false });
sandbox = Components.utils.Sandbox(window, { sandboxPrototype: proto || modules,
sandboxName: name || ("Dactyl Sandbox " + ++_id),
wantXrays: false });
// Hack:
// sandbox.Object = jsmodules.Object;
sandbox.File = jsmodules.File;
sandbox.Math = jsmodules.Math;
sandbox.Set = jsmodules.Set;
sandbox.__proto__ = proto || modules;
return sandbox;
},