1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-06 16:04:12 +01:00

Remove obsolete global private browsing code.

This commit is contained in:
Kris Maglione
2015-03-09 19:24:51 -07:00
parent daaea67294
commit 1bcc5502e7
7 changed files with 7 additions and 41 deletions

View File

@@ -1587,18 +1587,6 @@ var Options = Module("options", {
dactyl.reportError(e); 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;
}
}
}); });
} }
}); });

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009 by Doug Kearns <dougkearns@gmail.com> // 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 // This work is licensed for reuse under an MIT license. Details are
// given in the LICENSE.txt file included with this file. // 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); apply(params, "action", arg);
}, },
getWindow(params.action)); 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: { observers: {
@@ -302,13 +293,6 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
if (this.runAtShutdown && !this.sanitizeItems(null, Range(), null, "shutdown")) if (this.runAtShutdown && !this.sanitizeItems(null, Range(), null, "shutdown"))
this.ranAtShutdown = true; 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) { autocommands: function initAutocommands(dactyl, modules, window) {
const { autocommands } = modules; const { autocommands } = modules;
storage.addObserver("private-mode",
function (key, event, value) {
autocommands.trigger("PrivateMode", { state: value });
}, window);
storage.addObserver("sanitizer", storage.addObserver("sanitizer",
function (key, event, value) { function (key, event, value) {
if (event == "domain") if (event == "domain")
@@ -447,8 +427,6 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
commands.add(["sa[nitize]"], commands.add(["sa[nitize]"],
"Clear private data", "Clear private data",
function (args) { function (args) {
dactyl.assert(!modules.options['private'], _("command.sanitize.privateMode"));
if (args["-host"] && !args.length && !args.bang) if (args["-host"] && !args.length && !args.bang)
args[0] = "all"; args[0] = "all";

View File

@@ -62,7 +62,6 @@ var Services = Module("Services", {
this.add("observer", "@mozilla.org/observer-service;1", "nsIObserverService"); this.add("observer", "@mozilla.org/observer-service;1", "nsIObserverService");
this.add("pref", "@mozilla.org/preferences-service;1", ["nsIPrefBranch2", "nsIPrefService"]); this.add("pref", "@mozilla.org/preferences-service;1", ["nsIPrefBranch2", "nsIPrefService"]);
this.add("printSettings", "@mozilla.org/gfx/printsettings-service;1", "nsIPrintSettingsService"); 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("profile", "@mozilla.org/toolkit/profile-service;1", "nsIToolkitProfileService");
this.add("resource:", this.PROTOCOL + "resource", ["nsIProtocolHandler", "nsIResProtocolHandler"]); this.add("resource:", this.PROTOCOL + "resource", ["nsIProtocolHandler", "nsIResProtocolHandler"]);
this.add("runtime", "@mozilla.org/xre/runtime;1", ["nsIXULAppInfo", "nsIXULRuntime"]); this.add("runtime", "@mozilla.org/xre/runtime;1", ["nsIXULAppInfo", "nsIXULRuntime"]);

View File

@@ -68,7 +68,7 @@ var StoreBase = Class("StoreBase", {
storage.infoPath.child(this.name).path); 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) "@@iterator": function () iter(this._object)
}); });
@@ -230,8 +230,9 @@ var Storage = Module("Storage", {
}, },
_saveData: promises.task(function* saveData(obj) { _saveData: promises.task(function* saveData(obj) {
if (obj.privateData && storage.privateMode) if (obj.privateData && this.privateMode)
return; return;
if (obj.store && storage.infoPath) { if (obj.store && storage.infoPath) {
var { path } = storage.infoPath.child(obj.name); var { path } = storage.infoPath.child(obj.name);
yield OS.File.makeDir(storage.infoPath.path, yield OS.File.makeDir(storage.infoPath.path,

View File

@@ -1,5 +1,6 @@
1.2pre: 1.2pre:
• Remove 'jsdebugger' option. • Remove 'jsdebugger' option.
• Remove defunct 'PrivateMode' autocommand.
1.1: 1.1:
• Vim runtime files: • Vim runtime files:
@@ -9,6 +10,7 @@
• Removed <F1> and <A-F1> mappings. • Removed <F1> and <A-F1> mappings.
• Add :private command. • Add :private command.
• Better per-window private browsing support. • Better per-window private browsing support.
• Removed 'private' option.
1.0: 1.0:
• Extensive Firefox 4 support, including: • Extensive Firefox 4 support, including:

View File

@@ -43,7 +43,6 @@
"LocationChange": "Triggered when changing tabs or when navigation to a new location", "LocationChange": "Triggered when changing tabs or when navigation to a new location",
"PageLoadPre": "Triggered after a page load is initiated", "PageLoadPre": "Triggered after a page load is initiated",
"PageLoad": "Triggered when a page gets (re)loaded/opened", "PageLoad": "Triggered when a page gets (re)loaded/opened",
"PrivateMode": "Triggered when private browsing mode is activated or deactivated",
"Sanitize": "Triggered when a sanitizeable item is cleared", "Sanitize": "Triggered when a sanitizeable item is cleared",
"ShellCmdPost": "Triggered after executing a shell command with :!cmd", "ShellCmdPost": "Triggered after executing a shell command with :!cmd",
"Enter": "Triggered after Firefox starts", "Enter": "Triggered after Firefox starts",

View File

@@ -18,7 +18,6 @@
<dt>LocationChange</dt> <dd>Triggered when changing tabs or when navigating to a new location</dd> <dt>LocationChange</dt> <dd>Triggered when changing tabs or when navigating to a new location</dd>
<dt>PageLoadPre</dt> <dd>Triggered after a page load is initiated</dd> <dt>PageLoadPre</dt> <dd>Triggered after a page load is initiated</dd>
<dt>PageLoad</dt> <dd>Triggered when a page gets (re)loaded/opened</dd> <dt>PageLoad</dt> <dd>Triggered when a page gets (re)loaded/opened</dd>
<dt>PrivateMode</dt> <dd>Triggered when private browsing mode is activated or deactivated</dd>
<dt>Sanitize</dt> <dd>Triggered when private data are sanitized</dd> <dt>Sanitize</dt> <dd>Triggered when private data are sanitized</dd>
<dt>ShellCmdPost</dt> <dd>Triggered after executing a shell command with <ex>:!</ex><a>cmd</a></dd> <dt>ShellCmdPost</dt> <dd>Triggered after executing a shell command with <ex>:!</ex><a>cmd</a></dd>
<dt>Enter</dt> <dd>Triggered after &dactyl.host; starts</dd> <dt>Enter</dt> <dd>Triggered after &dactyl.host; starts</dd>
@@ -35,7 +34,7 @@
<dt>&lt;keyword></dt> <dd>The keywords applied to the bookmark. Only for <em>BookmarkChange</em>, <em>BookmarkRemove</em>.</dd> <dt>&lt;keyword></dt> <dd>The keywords applied to the bookmark. Only for <em>BookmarkChange</em>, <em>BookmarkRemove</em>.</dd>
<dt>&lt;name></dt> <dd>The name of the item. Only for <em>ColorScheme</em> and <em>Sanitize</em>.</dd> <dt>&lt;name></dt> <dd>The name of the item. Only for <em>ColorScheme</em> and <em>Sanitize</em>.</dd>
<dt>&lt;size></dt> <dd>The size of a downloaded file. Only for <em>DownloadPost</em>.</dd> <dt>&lt;size></dt> <dd>The size of a downloaded file. Only for <em>DownloadPost</em>.</dd>
<dt>&lt;state></dt> <dd>The new state. Only for <em>Fullscreen</em> and <em>PrivateMode</em>.</dd> <dt>&lt;state></dt> <dd>The new state. Only for <em>Fullscreen</em>.</dd>
<dt>&lt;tab></dt> <dd>The tab in which the event occurred. Only for <em>DOMLoad</em>, <em>PageLoad</em> and <em>PageLoadPre</em>.</dd> <dt>&lt;tab></dt> <dd>The tab in which the event occurred. Only for <em>DOMLoad</em>, <em>PageLoad</em> and <em>PageLoadPre</em>.</dd>
<dt>&lt;tags></dt> <dd>The tags applied to <em>&lt;url></em>. Only for <em>Bookmark*</em>.</dd> <dt>&lt;tags></dt> <dd>The tags applied to <em>&lt;url></em>. Only for <em>Bookmark*</em>.</dd>
<dt>&lt;title></dt> <dd>The page, bookmark or download title.</dd> <dt>&lt;title></dt> <dd>The page, bookmark or download title.</dd>