Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim:sw=4:sr:sta:et:sts: */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 const Cc = Components.classes;
9 const Ci = Components.interfaces;
10 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
12 function jsConsoleHandler() {}
13 jsConsoleHandler.prototype = {
14 handle: function clh_handle(cmdLine) {
15 if (!cmdLine.handleFlag("jsconsole", false))
16 return;
18 var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
19 getService(Ci.nsIWindowMediator);
20 var console = wm.getMostRecentWindow("global:console");
21 if (!console) {
22 var wwatch = Cc["@mozilla.org/embedcomp/window-watcher;1"].
23 getService(Ci.nsIWindowWatcher);
24 wwatch.openWindow(null, "chrome://global/content/console.xul", "_blank",
25 "chrome,dialog=no,all", cmdLine);
26 } else {
27 console.focus(); // the Error console was already open
28 }
30 if (cmdLine.state == Ci.nsICommandLine.STATE_REMOTE_AUTO)
31 cmdLine.preventDefault = true;
32 },
34 helpInfo : " -jsconsole Open the Error console.\n",
36 classID: Components.ID("{2cd0c310-e127-44d0-88fc-4435c9ab4d4b}"),
37 QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
38 };
40 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([jsConsoleHandler]);