diff --git a/common/content/commandline.js b/common/content/commandline.js index 4afb62c6..f01cbb0b 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -1002,12 +1002,18 @@ var CommandLine = Module("commandline", { save: function save() { if (events.feedingKeys) return; + let str = this.input.value; if (/^\s*$/.test(str)) return; + + let privateData = this.checkPrivate(str); + if (privateData == "never-save") + return; + this.store = this.store.filter(function (line) (line.value || line) != str); dactyl.trapErrors(function () { - this.store.push({ value: str, timestamp: Date.now()*1000, privateData: this.checkPrivate(str) }); + this.store.push({ value: str, timestamp: Date.now()*1000, privateData: privateData }); }, this); this.store = this.store.slice(Math.max(0, this.store.length - options["history"])); }, diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 68407b8f..c0cce9af 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -164,6 +164,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { NEW_WINDOW: "window", forceBackground: null, + forcePrivate: null, forceTarget: null, get forceOpen() ({ background: this.forceBackground, @@ -955,7 +956,11 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { }); case dactyl.NEW_WINDOW: - let win = window.openDialog(document.documentURI, "_blank", "chrome,all,dialog=no"); + let options = ["chrome", "all", "dialog=no"]; + if (dactyl.forcePrivate) + options.push("private"); + + let win = window.openDialog(document.documentURI, "_blank", options.join(",")); util.waitFor(function () win.document.readyState === "complete"); browser = win.dactyl && win.dactyl.modules.config.tabbrowser || win.getBrowser(); // FALLTHROUGH @@ -1560,6 +1565,21 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { literal: 0 }); + commands.add(["pr[ivate]", "pr0n", "porn"], + "Enable privacy features of a command, when applicable, and do not save the invocation in command history", + function (args) { + dactyl.withSavedValues(["forcePrivate"], function () { + this.forcePrivate = true; + dactyl.execute(args[0], null, true); + }); + }, { + argCount: "1", + completer: function (context) completion.ex(context), + literal: 0, + privateData: "never-save", + subCommand: 0 + }); + commands.add(["exit", "x"], "Quit " + config.appName, function (args) { diff --git a/common/locale/en-US/browsing.xml b/common/locale/en-US/browsing.xml index de536683..d526ba80 100644 --- a/common/locale/en-US/browsing.xml +++ b/common/locale/en-US/browsing.xml @@ -143,6 +143,10 @@ Like :tabopen, but all arguments are opened in a single new window.

+

+ When called via :private, the new window is a + private browsing window. +

diff --git a/common/locale/en-US/privacy.xml b/common/locale/en-US/privacy.xml index db936e49..ee7e6b8c 100644 --- a/common/locale/en-US/privacy.xml +++ b/common/locale/en-US/privacy.xml @@ -109,6 +109,19 @@ + + :private :pr + :pr0n :porn + + :private cmd + +

+ Execute cmd with privacy features enabled, and + do not save the invocation in command history. +

+
+
+

Cookie settings

:cookies :ck diff --git a/common/modules/commands.jsm b/common/modules/commands.jsm index ba654c44..199cfff1 100644 --- a/common/modules/commands.jsm +++ b/common/modules/commands.jsm @@ -915,7 +915,8 @@ var Commands = Module("commands", { hasPrivateData: function hasPrivateData(command) { for (let [cmd, args] in this.subCommands(command)) if (cmd.privateData) - return !callable(cmd.privateData) || cmd.privateData(args); + return !callable(cmd.privateData) ? cmd.privateData + : cmd.privateData(args); return false; }, diff --git a/pentadactyl/NEWS b/pentadactyl/NEWS index d653d640..8912f301 100644 --- a/pentadactyl/NEWS +++ b/pentadactyl/NEWS @@ -4,6 +4,8 @@ all Vim related files. - Vimball packages are no longer available. • Removed and mappings. + • Add :private command. + • Better per-window private browsing support. 1.0: • Extensive Firefox 4 support, including: