Bug 1574667 - The Site information header shows the wrong name for chrome:// URLs r=johannh
authoraarushivij <aarushivij@gmail.com>
Mon, 09 Mar 2020 15:35:28 +0000
changeset 517598 87eede8b84f5caf402f363fbbf36dfe5b69a10a9
parent 517597 c6750fcff317a4d7ba10590629c0b62860f9ebf7
child 517599 ae9ff80929d8d4f5ef002fa80ffef8c9f40d3c5e
push id109507
push userjhofmann@mozilla.com
push dateMon, 09 Mar 2020 15:36:40 +0000
treeherderautoland@87eede8b84f5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1574667
milestone75.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1574667 - The Site information header shows the wrong name for chrome:// URLs r=johannh Differential Revision: https://phabricator.services.mozilla.com/D65955
browser/base/content/browser-siteIdentity.js
browser/base/content/test/siteIdentity/browser_identity_UI.js
--- a/browser/base/content/browser-siteIdentity.js
+++ b/browser/base/content/browser-siteIdentity.js
@@ -640,16 +640,20 @@ var gIdentityHandler = {
     if (this._uri.schemeIs("about")) {
       // For example in about:certificate the original URL is
       // about:certificate?cert=<large base64 encoded data>&cert=<large base64 encoded data>&cert=...
       // So, instead of showing that large string in the identity panel header, we are just showing
       // about:certificate now. For the other about pages we are just showing about:<page>
       host = "about:" + this._uri.filePath;
     }
 
+    if (this._uri.schemeIs("chrome")) {
+      host = this._uri.spec;
+    }
+
     let readerStrippedURI = ReaderMode.getOriginalUrlObjectForDisplay(
       this._uri.displaySpec
     );
     if (readerStrippedURI) {
       host = readerStrippedURI.host;
     }
 
     if (this._pageExtensionPolicy) {
--- a/browser/base/content/test/siteIdentity/browser_identity_UI.js
+++ b/browser/base/content/test/siteIdentity/browser_identity_UI.js
@@ -52,16 +52,21 @@ var tests = [
       "about:certificate?cert=MIIHQjCCBiqgAwIBAgIQCgYwQn9bvO&cert=1pVzllk7ZFHzANBgkqhkiG9w0BAQ",
     hostForDisplay: "about:certificate",
   },
   {
     name: "about:reader",
     location: "about:reader?url=http://example.com",
     hostForDisplay: "example.com",
   },
+  {
+    name: "chrome:",
+    location: "chrome://global/skin/in-content/info-pages.css",
+    hostForDisplay: "chrome://global/skin/in-content/info-pages.css",
+  },
 ];
 
 add_task(async function test() {
   ok(gIdentityHandler, "gIdentityHandler should exist");
 
   await BrowserTestUtils.openNewForegroundTab(gBrowser);
 
   for (let i = 0; i < tests.length; i++) {