mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-30 01:15:47 +01:00
Use services.dactyl when available.
This commit is contained in:
@@ -139,7 +139,13 @@ var Modules = function Modules(window) {
|
||||
newContext: function newContext(proto, normal) {
|
||||
if (normal)
|
||||
return create(proto);
|
||||
let sandbox = Components.utils.Sandbox(window, { sandboxPrototype: proto || modules, wantXrays: false });
|
||||
|
||||
if (services.has("dactyl") && services.dactyl.createGlobal)
|
||||
var sandbox = services.dactyl.createGlobal();
|
||||
else
|
||||
sandbox = Components.utils.Sandbox(window, { sandboxPrototype: proto || modules,
|
||||
wantXrays: false });
|
||||
|
||||
// Hack:
|
||||
sandbox.Object = jsmodules.Object;
|
||||
sandbox.File = jsmodules.File;
|
||||
|
||||
Reference in New Issue
Block a user