diff --git a/common/content/editor.js b/common/content/editor.js index 210c43f0..63ec3eb6 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -455,7 +455,7 @@ var Editor = Module("editor", XPCOM(Ci.nsIEditActionListener, ModuleBase), { if (textBox) { textBox.value = val; - if (false) { + if (true) { let elem = DOM(textBox); elem.attrNS(NS, "modifiable", true) .style.MozUserInput; diff --git a/common/modules/contexts.jsm b/common/modules/contexts.jsm index 46819365..6d32fb83 100644 --- a/common/modules/contexts.jsm +++ b/common/modules/contexts.jsm @@ -222,7 +222,10 @@ var Contexts = Module("contexts", { util.trapErrors("onUnload", self); } else { - self = args && !isArray(args) ? args : newContext.apply(null, args || [userContext]); + let params = Array.slice(args || [userContext]); + params[2] = params[2] || File(file).URI.spec; + + self = args && !isArray(args) ? args : newContext.apply(null, params); update(self, { NAME: Const(id), diff --git a/common/modules/javascript.jsm b/common/modules/javascript.jsm index 3cd1100d..f08c2d13 100644 --- a/common/modules/javascript.jsm +++ b/common/modules/javascript.jsm @@ -53,7 +53,7 @@ var JavaScript = Module("javascript", { lazyInit: true, - newContext: function () this.modules.newContext(this.modules.userContext, true), + newContext: function () this.modules.newContext(this.modules.userContext, true, "Dactyl JS Temp Context"), completers: Class.Memoize(function () Object.create(JavaScript.completers)), @@ -765,10 +765,10 @@ var JavaScript = Module("javascript", { let self = this; let sandbox = true || isinstance(context, ["Sandbox"]); - this.context = modules.newContext(context, !sandbox); + this.context = modules.newContext(context, !sandbox, "Dactyl REPL Context"); this.js = modules.JavaScript(); this.js.replContext = this.context; - this.js.newContext = function newContext() modules.newContext(self.context, !sandbox); + this.js.newContext = function newContext() modules.newContext(self.context, !sandbox, "Dactyl REPL Temp Context"); this.js.globals = [ [this.context, /*L*/"REPL Variables"], diff --git a/common/modules/main.jsm b/common/modules/main.jsm index 2740b66d..27bcc609 100644 --- a/common/modules/main.jsm +++ b/common/modules/main.jsm @@ -28,6 +28,8 @@ var ModuleBase = Class("ModuleBase", { toString: function () "[module " + this.constructor.className + "]" }); +var _id = 0; + var Modules = function Modules(window) { /** * @constructor Module @@ -136,7 +138,7 @@ var Modules = function Modules(window) { } }, - newContext: function newContext(proto, normal) { + newContext: function newContext(proto, normal, name) { if (normal) return create(proto); @@ -144,6 +146,7 @@ var Modules = function Modules(window) { var sandbox = services.dactyl.createGlobal(); else sandbox = Components.utils.Sandbox(window, { sandboxPrototype: proto || modules, + sandboxName: name || ("Dactyl Sandbox " + ++_id), wantXrays: false }); // Hack: