mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-31 03:12:29 +01:00
More per-window private browsing fixes.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user