Bug 1554700 - Set up an RPM handler for about:certificate r=johannh

Differential Revision: https://phabricator.services.mozilla.com/D32707

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Carolina 2019-05-28 07:44:44 +00:00
Родитель 52443a5de3
Коммит 4543bf941b
6 изменённых файлов: 65 добавлений и 0 удалений

Просмотреть файл

@ -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();

Просмотреть файл

@ -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;
}
}
},
};

Просмотреть файл

@ -9,6 +9,7 @@
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Security-Policy" content="default-src chrome:" />
<title>about:certificate</title>
<script src="chrome://global/content/certviewer/certviewer.js"></script>
</head>
<body>
<h1>Certificate Viewer</h1>

Просмотреть файл

@ -0,0 +1,12 @@
/* 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/. */
/* eslint-env mozilla/frame-script */
"use strict";
document.addEventListener("DOMContentLoaded", (e) => {
RPMSendAsyncMessage("getCertificate");
});

Просмотреть файл

@ -4,3 +4,4 @@
toolkit.jar:
content/global/certviewer/certviewer.html (content/certviewer.html)
content/global/certviewer/certviewer.js (content/certviewer.js)

Просмотреть файл

@ -6,5 +6,9 @@
JAR_MANIFESTS += ['jar.mn']
EXTRA_JS_MODULES += [
'AboutCertViewerHandler.jsm',
]
with Files('**'):
BUG_COMPONENT = ("Firefox", "Security")