diff --git a/browser/base/content/browser-contentblocking.js b/browser/base/content/browser-contentblocking.js index 69b74c3b309d..fc4ae965d06c 100644 --- a/browser/base/content/browser-contentblocking.js +++ b/browser/base/content/browser-contentblocking.js @@ -445,10 +445,10 @@ var ContentBlocking = { blocker.categoryItem.hidden = !blocker.visible; } + let isBrowserPrivate = PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser); + // Check whether the user has added an exception for this site. - let type = PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser) ? - "trackingprotection-pb" : - "trackingprotection"; + let type = isBrowserPrivate ? "trackingprotection-pb" : "trackingprotection"; let hasException = Services.perms.testExactPermission(baseURI, type) == Services.perms.ALLOW_ACTION; @@ -463,11 +463,13 @@ var ContentBlocking = { } else if (active && webProgress.isTopLevel) { this.iconBox.setAttribute("animate", "true"); - let introCount = Services.prefs.getIntPref(this.prefIntroCount); - if (introCount < this.MAX_INTROS) { - Services.prefs.setIntPref(this.prefIntroCount, ++introCount); - Services.prefs.savePrefFile(null); - this.showIntroPanel(); + if (!isBrowserPrivate) { + let introCount = Services.prefs.getIntPref(this.prefIntroCount); + if (introCount < this.MAX_INTROS) { + Services.prefs.setIntPref(this.prefIntroCount, ++introCount); + Services.prefs.savePrefFile(null); + this.showIntroPanel(); + } } } diff --git a/browser/base/content/browser-pageActions.js b/browser/base/content/browser-pageActions.js index f190c62109e2..a9b628b53f6f 100644 --- a/browser/base/content/browser-pageActions.js +++ b/browser/base/content/browser-pageActions.js @@ -1236,7 +1236,7 @@ BrowserPageActions.shareURL = { fragment.appendChild(item); }); - let item = document.createElement("toolbarbutton"); + let item = document.createXULElement("toolbarbutton"); item.setAttribute("label", BrowserPageActions.panelNode.getAttribute("shareMore-label")); item.classList.add("subviewbutton", "subviewbutton-iconic", "share-more-button"); item.addEventListener("command", onCommand); diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css index 0dae54bfbc93..35ed7ee78ac9 100644 --- a/browser/base/content/browser.css +++ b/browser/base/content/browser.css @@ -597,7 +597,9 @@ html|input.urlbar-scheme[textoverflow="start"]:not([focused]):valid { visibility: visible; } -/* Fade out URL on overflow */ +/* Fade out URL on overflow + This mask may be overriden when a Contextual Feature Recommendation is shown, + see browser/themes/shared/urlbar-searchbar.inc.css for details */ html|input.urlbar-input[textoverflow="end"]:not([focused]) { mask-image: linear-gradient(to left, transparent, black 3ch); } @@ -606,6 +608,10 @@ html|input.urlbar-input[textoverflow="start"]:not([focused]) { mask-image: linear-gradient(to right, transparent var(--urlbar-scheme-size), black calc(var(--urlbar-scheme-size) + 3ch)); } +html|input.urlbar-input:not([focused]) { + mask-repeat: no-repeat; +} + /* Apply crisp rendering for favicons at exactly 2dppx resolution */ @media (resolution: 2dppx) { .searchbar-engine-image { diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 5a5b0f8466d8..d160780d4cd5 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1141,19 +1141,6 @@ function RedirectLoad({ target: browser, data }) { } } -if (document.documentElement.getAttribute("windowtype") == "navigator:browser") { - window.addEventListener("MozBeforeInitialXULLayout", () => { - gBrowserInit.onBeforeInitialXULLayout(); - }, { once: true }); - // The listener of DOMContentLoaded must be set on window, rather than - // document, because the window can go away before the event is fired. - // In that case, we don't want to initialize anything, otherwise we - // may be leaking things because they will never be destroyed after. - window.addEventListener("DOMContentLoaded", () => { - gBrowserInit.onDOMContentLoaded(); - }, { once: true }); -} - let _resolveDelayedStartup; var delayedStartupPromise = new Promise(resolve => { _resolveDelayedStartup = resolve; diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 42ff6aa91384..61b518a7947b 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -37,7 +37,6 @@ xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - onload="gBrowserInit.onLoad()" onunload="gBrowserInit.onUnload()" onclose="return WindowIsClosing();" title="&mainWindow.title;" title_normal="&mainWindow.title;" #ifdef XP_MACOSX @@ -79,6 +78,23 @@ xmlns="http://www.w3.org/1999/xhtml" > Services.scriptloader.loadSubScript("chrome://global/content/contentAreaUtils.js", this); Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser.js", this); + + window.onload = gBrowserInit.onLoad.bind(gBrowserInit); + window.onunload = gBrowserInit.onUnload.bind(gBrowserInit); + window.onclose = WindowIsClosing; +#ifdef BROWSER_XHTML + window.addEventListener("DOMContentLoaded", + gBrowserInit.onBeforeInitialXULLayout.bind(gBrowserInit), { once: true }); +#else + window.addEventListener("MozBeforeInitialXULLayout", + gBrowserInit.onBeforeInitialXULLayout.bind(gBrowserInit), { once: true }); +#endif + // The listener of DOMContentLoaded must be set on window, rather than + // document, because the window can go away before the event is fired. + // In that case, we don't want to initialize anything, otherwise we + // may be leaking things because they will never be destroyed after. + window.addEventListener("DOMContentLoaded", + gBrowserInit.onDOMContentLoaded.bind(gBrowserInit), { once: true }); # All sets except for popupsets (commands, keys, and stringbundles) @@ -906,6 +922,14 @@ xmlns="http://www.w3.org/1999/xhtml"