diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 2d882e4b..68407b8f 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1420,7 +1420,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { document.title = document.title.replace(RegExp("(.*)" + util.regexp.escape(old)), "$1" + current); } - if (services.has("privateBrowsing")) { + if (win.hasAttribute("titlemodifier_privatebrowsing")) { let oldValue = win.getAttribute("titlemodifier_normal"); let suffix = win.getAttribute("titlemodifier_privatebrowsing").substr(oldValue.length); diff --git a/common/modules/base.jsm b/common/modules/base.jsm index f2a7af36..88c4215d 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -133,7 +133,7 @@ function require_(obj, name, from, targetName) { defineModule("base", { // sed -n 's/^(const|var|function) ([a-zA-Z0-9_]+).*/ "\2",/p' base.jsm | sort | fmt exports: [ - "ErrorBase", "Cc", "Ci", "Class", "Cr", "Cu", "Module", "JSMLoader", + "ErrorBase", "Cc", "Ci", "Class", "Cr", "Cu", "Finished", "Module", "JSMLoader", "Set", "Struct", "StructBase", "Timer", "UTF8", "XPCOM", "XPCOMShim", "XPCOMUtils", "XPCSafeJSObjectWrapper", "array", "bind", "call", "callable", "ctypes", "curry", "debuggerProperties", "defineModule", "deprecated", "endModule", "forEach", "isArray", @@ -1110,6 +1110,12 @@ var ErrorBase = Class("ErrorBase", Error, { toString: function () String(this.message) }); +/** + * An Error subclass to throw in order to stop sourcing a plugin without + * printing a stack trace. + */ +var Finished = Class("Finished", ErrorBase); + /** * Constructs a new Module class and instantiates an instance into the current * module global object. diff --git a/common/modules/io.jsm b/common/modules/io.jsm index 9eb6d2ba..9e717d74 100644 --- a/common/modules/io.jsm +++ b/common/modules/io.jsm @@ -151,7 +151,7 @@ var IO = Module("io", { dactyl.triggerObserver("io.source", context, file, file.lastModifiedTime); } - if (/\.js,$/.test(filename)) + if (/\.jsm$/.test(filename)) sourceJSM(); else if (/\.js$/.test(filename)) { try { @@ -168,6 +168,8 @@ var IO = Module("io", { sourceJSM(); } else { + if (e instanceof Finished) + return; if (e.fileName && !(e instanceof FailedAssertion)) try { e.fileName = util.fixURI(e.fileName); diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm index a928fff1..9b4eb547 100644 --- a/common/modules/sanitizer.jsm +++ b/common/modules/sanitizer.jsm @@ -121,12 +121,16 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef }, override: true }); - if (services.has("privateBrowsing")) + try { + var { ForgetAboutSite } = Cu.import("resource://gre/modules/ForgetAboutSite.jsm", {}); + } + catch (e) {} + if (ForgetAboutSite) this.addItem("host", { description: "All data from the given host", action: function (range, host) { if (host) - services.privateBrowsing.removeDataFromDomain(host); + ForgetAboutSite.removeDataFromDomain(host); } }); this.addItem("sitesettings", { @@ -595,7 +599,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef }, options: function initOptions(dactyl, modules) { const options = modules.options; - if (services.has("privateBrowsing")) + if (services.has("privateBrowsing") && "privateBrowsingEnabled" in services.privateBrowsing) options.add(["private", "pornmode"], "Set the 'private browsing' option", "boolean", false, diff --git a/common/skin/global-styles.css b/common/skin/global-styles.css index 45fe12b9..b09f4022 100644 --- a/common/skin/global-styles.css +++ b/common/skin/global-styles.css @@ -1,4 +1,3 @@ - Boolean /* JavaScript booleans */ color: red; Function /* JavaScript functions */ color: navy; Null /* JavaScript null values */ color: blue; @@ -77,6 +76,14 @@ StatusWarningMsg /* A warning message in the status line */ \ Disabled /* Disabled items */ \ color: gray !important; +!Private;xul|window[privatebrowsingmode] /* A private browsing window */ + +Private StatusLine::before /* From the default theme: */ \ + display: -moz-box; \ + content: ""; \ + background: url("chrome://browser/skin/privatebrowsing-mask.png") center no-repeat; \ + width: 30px; + CmdLine;>*;;FontFixed /* The command line */ \ padding: 1px !important; CmdPrompt;.dactyl-commandline-prompt /* The default styling form the command prompt */