mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-28 23:12:26 +01:00
Remove obsolete global private browsing code.
This commit is contained in:
@@ -1587,18 +1587,6 @@ var Options = Module("options", {
|
||||
dactyl.reportError(e);
|
||||
}
|
||||
},
|
||||
privateEnter: function privateEnter() {
|
||||
for (let opt of values(modules.options._options))
|
||||
if (opt.privateData && (!callable(opt.privateData) || opt.privateData(opt.value)))
|
||||
opt.oldValue = opt.value;
|
||||
},
|
||||
privateLeave: function privateLeave() {
|
||||
for (let opt of values(modules.options._options))
|
||||
if (opt.oldValue != null) {
|
||||
opt.value = opt.oldValue;
|
||||
opt.oldValue = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright (c) 2009 by Doug Kearns <dougkearns@gmail.com>
|
||||
// Copyright (c) 2009-2014 Kris Maglione <maglione.k at Gmail>
|
||||
// Copyright (c) 2009-2015 Kris Maglione <maglione.k at Gmail>
|
||||
//
|
||||
// This work is licensed for reuse under an MIT license. Details are
|
||||
// given in the LICENSE.txt file included with this file.
|
||||
@@ -273,15 +273,6 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
|
||||
apply(params, "action", arg);
|
||||
},
|
||||
getWindow(params.action));
|
||||
|
||||
if (params.privateEnter || params.privateLeave)
|
||||
storage.addObserver("private-mode",
|
||||
function (key, event, arg) {
|
||||
let meth = params[arg ? "privateEnter" : "privateLeave"];
|
||||
if (meth)
|
||||
meth.call(params);
|
||||
},
|
||||
getWindow(params.privateEnter || params.privateLeave));
|
||||
},
|
||||
|
||||
observers: {
|
||||
@@ -302,13 +293,6 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
|
||||
if (this.runAtShutdown && !this.sanitizeItems(null, Range(), null, "shutdown"))
|
||||
this.ranAtShutdown = true;
|
||||
},
|
||||
"private-browsing": function (subject, data) {
|
||||
if (data == "enter")
|
||||
storage.privateMode = true;
|
||||
else if (data == "exit")
|
||||
storage.privateMode = false;
|
||||
storage.fireEvent("private-mode", "change", storage.privateMode);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -430,10 +414,6 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
|
||||
autocommands: function initAutocommands(dactyl, modules, window) {
|
||||
const { autocommands } = modules;
|
||||
|
||||
storage.addObserver("private-mode",
|
||||
function (key, event, value) {
|
||||
autocommands.trigger("PrivateMode", { state: value });
|
||||
}, window);
|
||||
storage.addObserver("sanitizer",
|
||||
function (key, event, value) {
|
||||
if (event == "domain")
|
||||
@@ -447,8 +427,6 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
|
||||
commands.add(["sa[nitize]"],
|
||||
"Clear private data",
|
||||
function (args) {
|
||||
dactyl.assert(!modules.options['private'], _("command.sanitize.privateMode"));
|
||||
|
||||
if (args["-host"] && !args.length && !args.bang)
|
||||
args[0] = "all";
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@ var Services = Module("Services", {
|
||||
this.add("observer", "@mozilla.org/observer-service;1", "nsIObserverService");
|
||||
this.add("pref", "@mozilla.org/preferences-service;1", ["nsIPrefBranch2", "nsIPrefService"]);
|
||||
this.add("printSettings", "@mozilla.org/gfx/printsettings-service;1", "nsIPrintSettingsService");
|
||||
this.add("privateBrowsing", "@mozilla.org/privatebrowsing;1", "nsIPrivateBrowsingService");
|
||||
this.add("profile", "@mozilla.org/toolkit/profile-service;1", "nsIToolkitProfileService");
|
||||
this.add("resource:", this.PROTOCOL + "resource", ["nsIProtocolHandler", "nsIResProtocolHandler"]);
|
||||
this.add("runtime", "@mozilla.org/xre/runtime;1", ["nsIXULAppInfo", "nsIXULRuntime"]);
|
||||
|
||||
@@ -68,7 +68,7 @@ var StoreBase = Class("StoreBase", {
|
||||
storage.infoPath.child(this.name).path);
|
||||
},
|
||||
|
||||
save: function () { (self.storage || storage)._saveData(this); },
|
||||
save: function () { (this.storage || storage)._saveData(this); },
|
||||
|
||||
"@@iterator": function () iter(this._object)
|
||||
});
|
||||
@@ -230,8 +230,9 @@ var Storage = Module("Storage", {
|
||||
},
|
||||
|
||||
_saveData: promises.task(function* saveData(obj) {
|
||||
if (obj.privateData && storage.privateMode)
|
||||
if (obj.privateData && this.privateMode)
|
||||
return;
|
||||
|
||||
if (obj.store && storage.infoPath) {
|
||||
var { path } = storage.infoPath.child(obj.name);
|
||||
yield OS.File.makeDir(storage.infoPath.path,
|
||||
|
||||
Reference in New Issue
Block a user