1
0
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:
Kris Maglione
2011-09-22 21:55:58 -04:00
parent 6af256bc53
commit e1db34990b
6 changed files with 147 additions and 31 deletions

View File

@@ -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;