Bug 1374463 - Show extension identity when controlling newtab r?mixedpuppy
MozReview-Commit-ID: 2phlLhlAvGd
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2760,17 +2760,17 @@ function URLBarSetURI(aURI) {
// We should deal with losslessDecodeURI throwing for exotic URIs
try {
value = losslessDecodeURI(uri);
} catch (ex) {
value = "about:blank";
}
}
- valid = !isBlankPageURL(uri.spec);
+ valid = !isBlankPageURL(uri.spec) || uri.schemeIs("moz-extension");
}
let isDifferentValidValue = valid && value != gURLBar.value;
gURLBar.value = value;
gURLBar.valueIsTyped = !valid;
gURLBar.removeAttribute("usertyping");
if (isDifferentValidValue) {
gURLBar.selectionStart = gURLBar.selectionEnd = 0;
--- a/browser/components/extensions/test/browser/browser_ext_identity_indication.js
+++ b/browser/components/extensions/test/browser/browser_ext_identity_indication.js
@@ -54,8 +54,44 @@ add_task(async function testIdentityIndi
await BrowserTestUtils.withNewTab({gBrowser, url}, async function() {
confirmExtensionPage();
});
await extension.unload();
confirmDefaults();
});
+
+add_task(async function testIdentityIndicationNewTab() {
+ let extension = ExtensionTestUtils.loadExtension({
+ background() {
+ browser.test.sendMessage("url", browser.extension.getURL("newtab.html"));
+ },
+ manifest: {
+ name: "Test Extension",
+ applications: {
+ gecko: {
+ id: "@newtab",
+ },
+ },
+ chrome_url_overrides: {
+ newtab: "newtab.html",
+ },
+ },
+ files: {
+ "newtab.html": "<h1>New tab!</h1>",
+ },
+ useAddonManager: "temporary",
+ });
+
+ await extension.startup();
+
+ confirmDefaults();
+
+ let url = await extension.awaitMessage("url");
+ await BrowserTestUtils.withNewTab({gBrowser, url}, async function() {
+ confirmExtensionPage();
+ });
+
+ await extension.unload();
+
+ confirmDefaults();
+});