diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-12-14 14:37:24 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-12-14 14:37:24 -0500 |
commit | 4e34c57467a8d38d593c6fbb7c0d63c3257e99f0 (patch) | |
tree | ff5ee62f90cebe34f23f734669e2c526d783caf0 /application/palemoon/modules/openLocationLastURL.jsm | |
parent | dacb3da00bd17e69f1a8f1080668808a5f3fe431 (diff) | |
download | UXP-4e34c57467a8d38d593c6fbb7c0d63c3257e99f0.tar UXP-4e34c57467a8d38d593c6fbb7c0d63c3257e99f0.tar.gz UXP-4e34c57467a8d38d593c6fbb7c0d63c3257e99f0.tar.lz UXP-4e34c57467a8d38d593c6fbb7c0d63c3257e99f0.tar.xz UXP-4e34c57467a8d38d593c6fbb7c0d63c3257e99f0.zip |
Remove Pale Moon from the Unified XUL Platform repository
Development will proceed at https://github.com/MoonchildProductions/Pale-Moon
Diffstat (limited to 'application/palemoon/modules/openLocationLastURL.jsm')
-rw-r--r-- | application/palemoon/modules/openLocationLastURL.jsm | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/application/palemoon/modules/openLocationLastURL.jsm b/application/palemoon/modules/openLocationLastURL.jsm deleted file mode 100644 index 3f58db8ce..000000000 --- a/application/palemoon/modules/openLocationLastURL.jsm +++ /dev/null @@ -1,85 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -const LAST_URL_PREF = "general.open_location.last_url"; -const nsISupportsString = Components.interfaces.nsISupportsString; -const Ci = Components.interfaces; - -Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); - -this.EXPORTED_SYMBOLS = [ "OpenLocationLastURL" ]; - -var prefSvc = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefBranch); -var gOpenLocationLastURLData = ""; - -var observer = { - QueryInterface: function (aIID) { - if (aIID.equals(Components.interfaces.nsIObserver) || - aIID.equals(Components.interfaces.nsISupports) || - aIID.equals(Components.interfaces.nsISupportsWeakReference)) - return this; - throw Components.results.NS_NOINTERFACE; - }, - observe: function (aSubject, aTopic, aData) { - switch (aTopic) { - case "last-pb-context-exited": - gOpenLocationLastURLData = ""; - break; - case "browser:purge-session-history": - prefSvc.clearUserPref(LAST_URL_PREF); - gOpenLocationLastURLData = ""; - break; - } - } -}; - -var os = Components.classes["@mozilla.org/observer-service;1"] - .getService(Components.interfaces.nsIObserverService); -os.addObserver(observer, "last-pb-context-exited", true); -os.addObserver(observer, "browser:purge-session-history", true); - - -this.OpenLocationLastURL = function OpenLocationLastURL(aWindow) { - this.window = aWindow; -} - -OpenLocationLastURL.prototype = { - isPrivate: function OpenLocationLastURL_isPrivate() { - // Assume not in private browsing mode, unless the browser window is - // in private mode. - if (!this.window) - return false; - - return PrivateBrowsingUtils.isWindowPrivate(this.window); - }, - get value() { - if (this.isPrivate()) - return gOpenLocationLastURLData; - else { - try { - return prefSvc.getComplexValue(LAST_URL_PREF, nsISupportsString).data; - } - catch (e) { - return ""; - } - } - }, - set value(val) { - if (typeof val != "string") - val = ""; - if (this.isPrivate()) - gOpenLocationLastURLData = val; - else { - let str = Components.classes["@mozilla.org/supports-string;1"] - .createInstance(Components.interfaces.nsISupportsString); - str.data = val; - prefSvc.setComplexValue(LAST_URL_PREF, nsISupportsString, str); - } - }, - reset: function() { - prefSvc.clearUserPref(LAST_URL_PREF); - gOpenLocationLastURLData = ""; - } -}; |