1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 16:47:58 +01:00

More per-window private browsing fixes.

This commit is contained in:
Kris Maglione
2013-04-26 19:14:36 -07:00
parent da332e7c2c
commit f166f50780
5 changed files with 26 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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

View File

@@ -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 */