diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-25 15:48:44 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-25 15:48:44 +0200 |
commit | 3ab6c7feee8126bdfc5c9ab9371db41102e12e95 (patch) | |
tree | a309c45826300b888238b6a517051fe7e71d63eb /browser/extensions/pocket/content/AboutPocket.jsm | |
parent | b18a9cf86ea25bc52d9cfea584e3aa8bfbe81f0a (diff) | |
parent | b069dabc91b7e0f5f8d161cdbe598276a21d6d68 (diff) | |
download | UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.tar UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.tar.gz UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.tar.lz UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.tar.xz UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.zip |
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into pm_url_1
Diffstat (limited to 'browser/extensions/pocket/content/AboutPocket.jsm')
-rw-r--r-- | browser/extensions/pocket/content/AboutPocket.jsm | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/browser/extensions/pocket/content/AboutPocket.jsm b/browser/extensions/pocket/content/AboutPocket.jsm deleted file mode 100644 index c7f57aa87..000000000 --- a/browser/extensions/pocket/content/AboutPocket.jsm +++ /dev/null @@ -1,93 +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/. */ -"use strict"; - -const { interfaces: Ci, results: Cr, manager: Cm, utils: Cu } = Components; - -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); - -// See LOG_LEVELS in Console.jsm. Common examples: "All", "Info", "Warn", & "Error". -const PREF_LOG_LEVEL = "loop.debug.loglevel"; - -XPCOMUtils.defineLazyGetter(this, "log", () => { - let ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI; - let consoleOptions = { - maxLogLevelPref: PREF_LOG_LEVEL, - prefix: "Loop" - }; - return new ConsoleAPI(consoleOptions); -}); - - -function AboutPage(chromeURL, aboutHost, classID, description, uriFlags) { - this.chromeURL = chromeURL; - this.aboutHost = aboutHost; - this.classID = Components.ID(classID); - this.description = description; - this.uriFlags = uriFlags; -} - -AboutPage.prototype = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]), - getURIFlags: function(aURI) { // eslint-disable-line no-unused-vars - return this.uriFlags; - }, - - newChannel: function(aURI, aLoadInfo) { - let newURI = Services.io.newURI(this.chromeURL, null, null); - let channel = Services.io.newChannelFromURIWithLoadInfo(newURI, - aLoadInfo); - channel.originalURI = aURI; - - if (this.uriFlags & Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT) { - let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(aURI); - channel.owner = principal; - } - return channel; - }, - - createInstance: function(outer, iid) { - if (outer !== null) { - throw Cr.NS_ERROR_NO_AGGREGATION; - } - return this.QueryInterface(iid); - }, - - register: function() { - Cm.QueryInterface(Ci.nsIComponentRegistrar).registerFactory( - this.classID, this.description, - "@mozilla.org/network/protocol/about;1?what=" + this.aboutHost, this); - }, - - unregister: function() { - Cm.QueryInterface(Ci.nsIComponentRegistrar).unregisterFactory( - this.classID, this); - } -}; - -/* exported AboutPocket */ -var AboutPocket = {}; - -XPCOMUtils.defineLazyGetter(AboutPocket, "aboutSaved", () => - new AboutPage("chrome://pocket/content/panels/saved.html", - "pocket-saved", - "{3e759f54-37af-7843-9824-f71b5993ceed}", - "About Pocket Saved", - Ci.nsIAboutModule.ALLOW_SCRIPT | - Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT | - Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT) -); - -XPCOMUtils.defineLazyGetter(AboutPocket, "aboutSignup", () => - new AboutPage("chrome://pocket/content/panels/signup.html", - "pocket-signup", - "{8548329d-00c4-234e-8f17-75026db3b56e}", - "About Pocket Signup", - Ci.nsIAboutModule.ALLOW_SCRIPT | - Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT | - Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT) -); - -this.EXPORTED_SYMBOLS = ["AboutPocket"]; |