diff --git a/browser/components/BrowserGlue.jsm b/browser/components/BrowserGlue.jsm index 0ac23486fb04..8bda99dbccb5 100644 --- a/browser/components/BrowserGlue.jsm +++ b/browser/components/BrowserGlue.jsm @@ -416,6 +416,7 @@ XPCOMUtils.defineLazyGetter(this, "WeaveService", () => // lazy module getters XPCOMUtils.defineLazyModuleGetters(this, { + AboutCertViewerHandler: "resource://gre/modules/AboutCertViewerHandler.jsm", AboutNetErrorHandler: "resource:///modules/aboutpages/AboutNetErrorHandler.jsm", AboutPrivateBrowsingHandler: "resource:///modules/aboutpages/AboutPrivateBrowsingHandler.jsm", AboutProtectionsHandler: "resource:///modules/aboutpages/AboutProtectionsHandler.jsm", @@ -1386,6 +1387,8 @@ BrowserGlue.prototype = { NewTabUtils.init(); + AboutCertViewerHandler.init(); + AboutNetErrorHandler.init(); AboutPrivateBrowsingHandler.init(); @@ -1538,6 +1541,7 @@ BrowserGlue.prototype = { PageThumbs.uninit(); NewTabUtils.uninit(); + AboutCertViewerHandler.uninit(); AboutNetErrorHandler.uninit(); AboutPrivateBrowsingHandler.uninit(); AboutProtectionsHandler.uninit(); diff --git a/toolkit/components/certviewer/AboutCertViewerHandler.jsm b/toolkit/components/certviewer/AboutCertViewerHandler.jsm new file mode 100644 index 000000000000..8e1c4f82edfd --- /dev/null +++ b/toolkit/components/certviewer/AboutCertViewerHandler.jsm @@ -0,0 +1,43 @@ +/* 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"; + +var EXPORTED_SYMBOLS = ["AboutCertViewerHandler"]; + +const { RemotePages } = ChromeUtils.import("resource://gre/modules/remotepagemanager/RemotePageManagerParent.jsm"); + +var AboutCertViewerHandler = { + _inited: false, + _topics: [ + "getCertificate", + ], + + init() { + this.pageListener = new RemotePages("about:certificate"); + for (let topic of this._topics) { + this.pageListener.addMessageListener(topic, this.receiveMessage); + } + this._inited = true; + }, + + uninit() { + if (!this._inited) { + return; + } + for (let topic of this._topics) { + this.pageListener.removeMessageListener(topic, this.receiveMessage); + } + this.pageListener.destroy(); + }, + + receiveMessage(aMessage) { + switch (aMessage.name) { + case "getCertificate": { + break; + } + } + }, +}; + diff --git a/toolkit/components/certviewer/content/certviewer.html b/toolkit/components/certviewer/content/certviewer.html index 2ad6c2aa679c..ce1b612a3de5 100644 --- a/toolkit/components/certviewer/content/certviewer.html +++ b/toolkit/components/certviewer/content/certviewer.html @@ -9,6 +9,7 @@