|
@@ -1,140 +1,10 @@
|
|
|
# HG changeset patch
|
|
|
# User Bill Gianopoulos <wgianopoulos@gmail.com>
|
|
|
# Date 1659988365 0
|
|
|
-# Parent 05d8f876218ab9bd2305a1e1f98a9b7734757a49
|
|
|
+# Parent 777be37684c4da6a70a6ca92c9d7717def4b2bc5
|
|
|
Bug 1783623 - Convert suite binary components registration to components.conf.
|
|
|
Port Bug 1524687 Part 11 to suite.
|
|
|
|
|
|
-diff --git a/suite/components/AboutRedirector.jsm b/suite/components/AboutRedirector.jsm
|
|
|
-new file mode 100644
|
|
|
---- /dev/null
|
|
|
-+++ b/suite/components/AboutRedirector.jsm
|
|
|
-@@ -0,0 +1,125 @@
|
|
|
-+/* 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/. */
|
|
|
-+
|
|
|
-+var EXPORTED_SYMBOLS = ["AboutRedirector"];
|
|
|
-+
|
|
|
-+function AboutRedirector() {}
|
|
|
-+AboutRedirector.prototype = {
|
|
|
-+ QueryInterface: ChromeUtils.generateQI(["nsIAboutModule"]),
|
|
|
-+
|
|
|
-+ // Each entry in the map has the key as the part after the "about:" and the
|
|
|
-+ // value as a record with url and flags entries. Note that each addition here
|
|
|
-+ // should be coupled with a corresponding addition in mailComponents.manifest.
|
|
|
-+ _redirMap: {
|
|
|
-+ newserror: {
|
|
|
-+ url: "chrome://messenger/content/newsError.xhtml",
|
|
|
-+ flags: Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
|
-+ },
|
|
|
-+ rights: {
|
|
|
-+ url: "chrome://messenger/content/aboutRights.xhtml",
|
|
|
-+ flags:
|
|
|
-+ Ci.nsIAboutModule.ALLOW_SCRIPT |
|
|
|
-+ Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT,
|
|
|
-+ },
|
|
|
-+ support: {
|
|
|
-+ url: "chrome://messenger/content/about-support/aboutSupport.xhtml",
|
|
|
-+ flags: Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
|
-+ },
|
|
|
-+ preferences: {
|
|
|
-+ url: "chrome://messenger/content/preferences/preferences.xhtml",
|
|
|
-+ flags: Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
|
-+ },
|
|
|
-+ downloads: {
|
|
|
-+ url: "chrome://messenger/content/downloads/aboutDownloads.xhtml",
|
|
|
-+ flags: Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
|
-+ },
|
|
|
-+ policies: {
|
|
|
-+ url: "chrome://messenger/content/policies/aboutPolicies.xhtml",
|
|
|
-+ flags: Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
|
-+ },
|
|
|
-+ accountsettings: {
|
|
|
-+ url: "chrome://messenger/content/AccountManager.xhtml",
|
|
|
-+ flags: Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
|
-+ },
|
|
|
-+ accountsetup: {
|
|
|
-+ url: "chrome://messenger/content/accountcreation/accountSetup.xhtml",
|
|
|
-+ flags: Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
|
-+ },
|
|
|
-+ accountprovisioner: {
|
|
|
-+ url: "chrome://messenger/content/newmailaccount/accountProvisioner.xhtml",
|
|
|
-+ flags: Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
|
-+ },
|
|
|
-+ addressbook: {
|
|
|
-+ url: "chrome://messenger/content/addressbook/aboutAddressBook.xhtml",
|
|
|
-+ flags: Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
|
-+ },
|
|
|
-+ "3pane": {
|
|
|
-+ url: "chrome://messenger/content/about3Pane.xhtml",
|
|
|
-+ flags: Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
|
-+ },
|
|
|
-+ message: {
|
|
|
-+ url: "chrome://messenger/content/aboutMessage.xhtml",
|
|
|
-+ flags: Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
|
-+ },
|
|
|
-+ import: {
|
|
|
-+ url: "chrome://messenger/content/aboutImport.xhtml",
|
|
|
-+ flags: Ci.nsIAboutModule.ALLOW_SCRIPT,
|
|
|
-+ },
|
|
|
-+ profiling: {
|
|
|
-+ url:
|
|
|
-+ "chrome://devtools/content/performance-new/aboutprofiling/index.xhtml",
|
|
|
-+ flags:
|
|
|
-+ Ci.nsIAboutModule.ALLOW_SCRIPT | Ci.nsIAboutModule.IS_SECURE_CHROME_UI,
|
|
|
-+ },
|
|
|
-+ },
|
|
|
-+
|
|
|
-+ /**
|
|
|
-+ * Gets the module name from the given URI.
|
|
|
-+ */
|
|
|
-+ _getModuleName(aURI) {
|
|
|
-+ // Strip out the first ? or #, and anything following it
|
|
|
-+ let name = /[^?#]+/.exec(aURI.pathQueryRef)[0];
|
|
|
-+ return name.toLowerCase();
|
|
|
-+ },
|
|
|
-+
|
|
|
-+ getURIFlags(aURI) {
|
|
|
-+ let name = this._getModuleName(aURI);
|
|
|
-+ if (!(name in this._redirMap)) {
|
|
|
-+ throw Components.Exception(`no about:${name}`, Cr.NS_ERROR_ILLEGAL_VALUE);
|
|
|
-+ }
|
|
|
-+ return this._redirMap[name].flags;
|
|
|
-+ },
|
|
|
-+
|
|
|
-+ newChannel(aURI, aLoadInfo) {
|
|
|
-+ let name = this._getModuleName(aURI);
|
|
|
-+ if (!(name in this._redirMap)) {
|
|
|
-+ throw Components.Exception(`no about:${name}`, Cr.NS_ERROR_ILLEGAL_VALUE);
|
|
|
-+ }
|
|
|
-+
|
|
|
-+ let newURI = Services.io.newURI(this._redirMap[name].url);
|
|
|
-+ let channel = Services.io.newChannelFromURIWithLoadInfo(newURI, aLoadInfo);
|
|
|
-+ channel.originalURI = aURI;
|
|
|
-+
|
|
|
-+ if (
|
|
|
-+ this._redirMap[name].flags &
|
|
|
-+ Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT
|
|
|
-+ ) {
|
|
|
-+ let principal = Services.scriptSecurityManager.createContentPrincipal(
|
|
|
-+ aURI,
|
|
|
-+ {}
|
|
|
-+ );
|
|
|
-+ channel.owner = principal;
|
|
|
-+ }
|
|
|
-+
|
|
|
-+ return channel;
|
|
|
-+ },
|
|
|
-+
|
|
|
-+ getChromeURI(aURI) {
|
|
|
-+ let name = this._getModuleName(aURI);
|
|
|
-+ if (!(name in this._redirMap)) {
|
|
|
-+ throw Components.Exception(`no about:${name}`, Cr.NS_ERROR_ILLEGAL_VALUE);
|
|
|
-+ }
|
|
|
-+ return Services.io.newURI(this._redirMap[name].url);
|
|
|
-+ },
|
|
|
-+};
|
|
|
diff --git a/suite/components/build/components.conf b/suite/components/build/components.conf
|
|
|
new file mode 100644
|
|
|
--- /dev/null
|
|
@@ -300,161 +170,3 @@ deleted file mode 100644
|
|
|
- kSuiteContracts,
|
|
|
- kSuiteCategories
|
|
|
-};
|
|
|
-diff --git a/suite/components/components.conf b/suite/components/components.conf
|
|
|
-new file mode 100644
|
|
|
---- /dev/null
|
|
|
-+++ b/suite/components/components.conf
|
|
|
-@@ -0,0 +1,27 @@
|
|
|
-+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
|
|
-+# vim: set filetype=python:
|
|
|
-+# 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/.
|
|
|
-+
|
|
|
-+pages = [
|
|
|
-+ 'blocked',
|
|
|
-+ 'certerror',
|
|
|
-+ 'data',
|
|
|
-+ 'feeds',
|
|
|
-+ 'life',
|
|
|
-+ 'newserror',
|
|
|
-+ 'privatebrowsing',
|
|
|
-+ 'rights',
|
|
|
-+ 'sessionrestore',
|
|
|
-+]
|
|
|
-+
|
|
|
-+Classes = [
|
|
|
-+ {
|
|
|
-+ 'cid': '{d54f2c89-8fd6-4eeb-a7a4-51d4dcdf460f}',
|
|
|
-+ 'contract_ids': ['@mozilla.org/network/protocol/about;1?what=%s' % page
|
|
|
-+ for page in pages],
|
|
|
-+ "jsm": "resource:///modules/AboutRedirector.jsm",
|
|
|
-+ 'constructor': 'AboutRedirector',
|
|
|
-+ },
|
|
|
-+]
|
|
|
-diff --git a/suite/components/moz.build b/suite/components/moz.build
|
|
|
---- a/suite/components/moz.build
|
|
|
-+++ b/suite/components/moz.build
|
|
|
-@@ -40,13 +40,20 @@ MOCHITEST_CHROME_MANIFESTS += [
|
|
|
-
|
|
|
- XPIDL_SOURCES += [
|
|
|
- "nsISuiteGlue.idl",
|
|
|
- ]
|
|
|
-
|
|
|
- XPIDL_MODULE = "suite-components"
|
|
|
-
|
|
|
- EXTRA_COMPONENTS += [
|
|
|
-- "nsAbout.js",
|
|
|
- "nsGopherProtocolStubHandler.js",
|
|
|
- "nsSuiteGlue.js",
|
|
|
- "SuiteComponents.manifest",
|
|
|
- ]
|
|
|
-+
|
|
|
-+EXTRA_JS_MODULES += [
|
|
|
-+ "AboutRedirector.jsm",
|
|
|
-+]
|
|
|
-+
|
|
|
-+XPCOM_MANIFESTS += [
|
|
|
-+ "components.conf",
|
|
|
-+]
|
|
|
-diff --git a/suite/components/nsAbout.js b/suite/components/nsAbout.js
|
|
|
-deleted file mode 100644
|
|
|
---- a/suite/components/nsAbout.js
|
|
|
-+++ /dev/null
|
|
|
-@@ -1,75 +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/. */
|
|
|
--
|
|
|
--var {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
|
--
|
|
|
--const SCRIPT = Ci.nsIAboutModule.ALLOW_SCRIPT;
|
|
|
--const UNTRUSTED = Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT;
|
|
|
--const HIDE = Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT;
|
|
|
--const INDEXEDDB = Ci.nsIAboutModule.ENABLE_INDEXED_DB;
|
|
|
--
|
|
|
--function About() { }
|
|
|
--About.prototype = {
|
|
|
-- Flags: SCRIPT,
|
|
|
-- URI: "chrome://communicator/content/about.xhtml",
|
|
|
-- blockedFlags: SCRIPT | UNTRUSTED | HIDE,
|
|
|
-- blockedURI: "chrome://communicator/content/blockedSite.xhtml",
|
|
|
-- certerrorFlags: SCRIPT | UNTRUSTED | HIDE,
|
|
|
-- certerrorURI: "chrome://communicator/content/certError.xhtml",
|
|
|
-- dataFlags: SCRIPT,
|
|
|
-- dataURI: "chrome://communicator/content/dataman/dataman.xhtml",
|
|
|
-- feedsFlags: SCRIPT | UNTRUSTED | HIDE,
|
|
|
-- feedsURI: "chrome://communicator/content/feeds/subscribe.xhtml",
|
|
|
-- lifeFlags: SCRIPT | UNTRUSTED | HIDE,
|
|
|
-- lifeURI: "chrome://communicator/content/aboutLife.xhtml",
|
|
|
-- newserrorFlags: SCRIPT | HIDE,
|
|
|
-- newserrorURI: "chrome://messenger/content/newsError.xhtml",
|
|
|
-- privatebrowsingFlags: SCRIPT,
|
|
|
-- privatebrowsingURI: "chrome://communicator/content/aboutPrivateBrowsing.xhtml",
|
|
|
-- rightsFlags: SCRIPT | UNTRUSTED,
|
|
|
-- rightsURI: "chrome://branding/content/aboutRights.xhtml",
|
|
|
-- sessionrestoreFlags: SCRIPT | HIDE,
|
|
|
-- sessionrestoreURI: "chrome://communicator/content/aboutSessionRestore.xhtml",
|
|
|
-- // synctabsFlags: SCRIPT,
|
|
|
-- // synctabsURI: "chrome://communicator/content/aboutSyncTabs.xhtml",
|
|
|
--
|
|
|
-- classID: Components.ID("{d54f2c89-8fd6-4eeb-a7a4-51d4dcdf460f}"),
|
|
|
-- QueryInterface: ChromeUtils.generateQI([Ci.nsIAboutModule]),
|
|
|
--
|
|
|
-- getModule: function(aURI) {
|
|
|
-- return aURI.pathQueryRef.replace(/-|\W.*$/g, "").toLowerCase();
|
|
|
-- },
|
|
|
--
|
|
|
-- getURIFlags: function(aURI) {
|
|
|
-- return this[this.getModule(aURI) + "Flags"];
|
|
|
-- },
|
|
|
--
|
|
|
-- newChannel: function(aURI, aLoadInfo) {
|
|
|
-- let module = this.getModule(aURI);
|
|
|
-- let newURI = Services.io.newURI(this[module + "URI"]);
|
|
|
--
|
|
|
-- // We want a happy family which is always providing a loadInfo object.
|
|
|
-- if (!aLoadInfo) {
|
|
|
-- // Write out an error so that we have a stack and can fix the caller.
|
|
|
-- Cu.reportError('aLoadInfo was not provided in nsAbout.newChannel!');
|
|
|
-- }
|
|
|
--
|
|
|
-- let channel = aLoadInfo ?
|
|
|
-- Services.io.newChannelFromURIWithLoadInfo(newURI, aLoadInfo) :
|
|
|
-- Services.io.newChannelFromURI(newURI, null,
|
|
|
-- Services.scriptSecurityManager.getSystemPrincipal(),
|
|
|
-- null,
|
|
|
-- Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL,
|
|
|
-- Ci.nsIContentPolicy.TYPE_OTHER);
|
|
|
--
|
|
|
-- channel.originalURI = aURI;
|
|
|
-- if (this[module + "Flags"] & UNTRUSTED) {
|
|
|
-- let principal = Services.scriptSecurityManager.createCodebasePrincipal(aURI, {});
|
|
|
-- channel.owner = principal;
|
|
|
-- }
|
|
|
-- return channel;
|
|
|
-- },
|
|
|
--};
|
|
|
--
|
|
|
--var NSGetFactory = XPCOMUtils.generateNSGetFactory([About]);
|
|
|
-diff --git a/suite/installer/package-manifest.in b/suite/installer/package-manifest.in
|
|
|
---- a/suite/installer/package-manifest.in
|
|
|
-+++ b/suite/installer/package-manifest.in
|
|
|
-@@ -157,17 +157,16 @@
|
|
|
- @RESPATH@/components/SuiteFeeds.manifest
|
|
|
- @RESPATH@/components/SuiteSidebar.manifest
|
|
|
- ; JavaScript components
|
|
|
- @RESPATH@/components/cryptoComponents.manifest
|
|
|
- @RESPATH@/components/FeedConverter.js
|
|
|
- @RESPATH@/components/FeedWriter.js
|
|
|
- @RESPATH@/components/jsconsole-clhandler.js
|
|
|
- @RESPATH@/components/jsconsole-clhandler.manifest
|
|
|
--@RESPATH@/components/nsAbout.js
|
|
|
- @RESPATH@/components/nsBrowserContentHandler.js
|
|
|
- @RESPATH@/components/nsComposerCmdLineHandler.js
|
|
|
- @RESPATH@/components/nsComposerCmdLineHandler.manifest
|
|
|
- @RESPATH@/components/nsGopherProtocolStubHandler.js
|
|
|
- @RESPATH@/components/nsPlacesAutoComplete.js
|
|
|
- @RESPATH@/components/nsPlacesAutoComplete.manifest
|
|
|
- @RESPATH@/components/nsSessionStartup.js
|
|
|
- @RESPATH@/components/nsSessionStartup.manifest
|