mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 12:27:58 +01:00
More per-window private browsing fixes.
This commit is contained in:
@@ -1420,7 +1420,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
|||||||
document.title = document.title.replace(RegExp("(.*)" + util.regexp.escape(old)), "$1" + current);
|
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 oldValue = win.getAttribute("titlemodifier_normal");
|
||||||
let suffix = win.getAttribute("titlemodifier_privatebrowsing").substr(oldValue.length);
|
let suffix = win.getAttribute("titlemodifier_privatebrowsing").substr(oldValue.length);
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ function require_(obj, name, from, targetName) {
|
|||||||
defineModule("base", {
|
defineModule("base", {
|
||||||
// sed -n 's/^(const|var|function) ([a-zA-Z0-9_]+).*/ "\2",/p' base.jsm | sort | fmt
|
// sed -n 's/^(const|var|function) ([a-zA-Z0-9_]+).*/ "\2",/p' base.jsm | sort | fmt
|
||||||
exports: [
|
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",
|
"Set", "Struct", "StructBase", "Timer", "UTF8", "XPCOM", "XPCOMShim", "XPCOMUtils",
|
||||||
"XPCSafeJSObjectWrapper", "array", "bind", "call", "callable", "ctypes", "curry",
|
"XPCSafeJSObjectWrapper", "array", "bind", "call", "callable", "ctypes", "curry",
|
||||||
"debuggerProperties", "defineModule", "deprecated", "endModule", "forEach", "isArray",
|
"debuggerProperties", "defineModule", "deprecated", "endModule", "forEach", "isArray",
|
||||||
@@ -1110,6 +1110,12 @@ var ErrorBase = Class("ErrorBase", Error, {
|
|||||||
toString: function () String(this.message)
|
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
|
* Constructs a new Module class and instantiates an instance into the current
|
||||||
* module global object.
|
* module global object.
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ var IO = Module("io", {
|
|||||||
dactyl.triggerObserver("io.source", context, file, file.lastModifiedTime);
|
dactyl.triggerObserver("io.source", context, file, file.lastModifiedTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (/\.js,$/.test(filename))
|
if (/\.jsm$/.test(filename))
|
||||||
sourceJSM();
|
sourceJSM();
|
||||||
else if (/\.js$/.test(filename)) {
|
else if (/\.js$/.test(filename)) {
|
||||||
try {
|
try {
|
||||||
@@ -168,6 +168,8 @@ var IO = Module("io", {
|
|||||||
sourceJSM();
|
sourceJSM();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (e instanceof Finished)
|
||||||
|
return;
|
||||||
if (e.fileName && !(e instanceof FailedAssertion))
|
if (e.fileName && !(e instanceof FailedAssertion))
|
||||||
try {
|
try {
|
||||||
e.fileName = util.fixURI(e.fileName);
|
e.fileName = util.fixURI(e.fileName);
|
||||||
|
|||||||
@@ -121,12 +121,16 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
|
|||||||
},
|
},
|
||||||
override: true
|
override: true
|
||||||
});
|
});
|
||||||
if (services.has("privateBrowsing"))
|
try {
|
||||||
|
var { ForgetAboutSite } = Cu.import("resource://gre/modules/ForgetAboutSite.jsm", {});
|
||||||
|
}
|
||||||
|
catch (e) {}
|
||||||
|
if (ForgetAboutSite)
|
||||||
this.addItem("host", {
|
this.addItem("host", {
|
||||||
description: "All data from the given host",
|
description: "All data from the given host",
|
||||||
action: function (range, host) {
|
action: function (range, host) {
|
||||||
if (host)
|
if (host)
|
||||||
services.privateBrowsing.removeDataFromDomain(host);
|
ForgetAboutSite.removeDataFromDomain(host);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.addItem("sitesettings", {
|
this.addItem("sitesettings", {
|
||||||
@@ -595,7 +599,7 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
|
|||||||
},
|
},
|
||||||
options: function initOptions(dactyl, modules) {
|
options: function initOptions(dactyl, modules) {
|
||||||
const options = modules.options;
|
const options = modules.options;
|
||||||
if (services.has("privateBrowsing"))
|
if (services.has("privateBrowsing") && "privateBrowsingEnabled" in services.privateBrowsing)
|
||||||
options.add(["private", "pornmode"],
|
options.add(["private", "pornmode"],
|
||||||
"Set the 'private browsing' option",
|
"Set the 'private browsing' option",
|
||||||
"boolean", false,
|
"boolean", false,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
Boolean /* JavaScript booleans */ color: red;
|
Boolean /* JavaScript booleans */ color: red;
|
||||||
Function /* JavaScript functions */ color: navy;
|
Function /* JavaScript functions */ color: navy;
|
||||||
Null /* JavaScript null values */ color: blue;
|
Null /* JavaScript null values */ color: blue;
|
||||||
@@ -77,6 +76,14 @@ StatusWarningMsg /* A warning message in the status line */ \
|
|||||||
Disabled /* Disabled items */ \
|
Disabled /* Disabled items */ \
|
||||||
color: gray !important;
|
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 */ \
|
CmdLine;>*;;FontFixed /* The command line */ \
|
||||||
padding: 1px !important;
|
padding: 1px !important;
|
||||||
CmdPrompt;.dactyl-commandline-prompt /* The default styling form the command prompt */
|
CmdPrompt;.dactyl-commandline-prompt /* The default styling form the command prompt */
|
||||||
|
|||||||
Reference in New Issue
Block a user