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.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); |
michael@0 | 6 | |
michael@0 | 7 | const Cc = Components.classes; |
michael@0 | 8 | const Ci = Components.interfaces; |
michael@0 | 9 | |
michael@0 | 10 | // Dummy boomark/history observer |
michael@0 | 11 | function DummyObserver() { |
michael@0 | 12 | let os = Cc["@mozilla.org/observer-service;1"]. |
michael@0 | 13 | getService(Ci.nsIObserverService); |
michael@0 | 14 | os.notifyObservers(null, "dummy-observer-created", null); |
michael@0 | 15 | } |
michael@0 | 16 | |
michael@0 | 17 | DummyObserver.prototype = { |
michael@0 | 18 | // history observer |
michael@0 | 19 | onBeginUpdateBatch: function () {}, |
michael@0 | 20 | onEndUpdateBatch: function () {}, |
michael@0 | 21 | onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID, aTransitionType) { |
michael@0 | 22 | let os = Cc["@mozilla.org/observer-service;1"]. |
michael@0 | 23 | getService(Ci.nsIObserverService); |
michael@0 | 24 | os.notifyObservers(null, "dummy-observer-visited", null); |
michael@0 | 25 | }, |
michael@0 | 26 | onTitleChanged: function () {}, |
michael@0 | 27 | onDeleteURI: function () {}, |
michael@0 | 28 | onClearHistory: function () {}, |
michael@0 | 29 | onPageChanged: function () {}, |
michael@0 | 30 | onDeleteVisits: function () {}, |
michael@0 | 31 | |
michael@0 | 32 | // bookmark observer |
michael@0 | 33 | //onBeginUpdateBatch: function() {}, |
michael@0 | 34 | //onEndUpdateBatch: function() {}, |
michael@0 | 35 | onItemAdded: function(aItemId, aParentId, aIndex, aItemType, aURI) { |
michael@0 | 36 | let os = Cc["@mozilla.org/observer-service;1"]. |
michael@0 | 37 | getService(Ci.nsIObserverService); |
michael@0 | 38 | os.notifyObservers(null, "dummy-observer-item-added", null); |
michael@0 | 39 | }, |
michael@0 | 40 | onItemChanged: function () {}, |
michael@0 | 41 | onItemRemoved: function() {}, |
michael@0 | 42 | onItemVisited: function() {}, |
michael@0 | 43 | onItemMoved: function() {}, |
michael@0 | 44 | |
michael@0 | 45 | classID: Components.ID("62e221d3-68c3-4e1a-8943-a27beb5005fe"), |
michael@0 | 46 | |
michael@0 | 47 | QueryInterface: XPCOMUtils.generateQI([ |
michael@0 | 48 | Ci.nsINavBookmarkObserver, |
michael@0 | 49 | Ci.nsINavHistoryObserver, |
michael@0 | 50 | ]) |
michael@0 | 51 | }; |
michael@0 | 52 | |
michael@0 | 53 | this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DummyObserver]); |