Bug 1476333 - Refer to AppConstants.BROWSER_CHROME_URL to get the browser URL from the frontend;r=Gijs
authorBrian Grinstead <bgrinstead@mozilla.com>
Tue, 24 Jul 2018 08:12:50 -0700
changeset 428171 dd386b5b9fa7f5cd6dc4bbbfa0503b3eb2969af5
parent 428170 f4181dab3ad85ae4636405b770621a9e8b218f19
child 428172 4ae19227350c99e5aba0ea970f1d994b86827f10
child 428250 789b4ff72fffb413aecba4dcc8290a1d2f916d74
push id105635
push usernbeleuzu@mozilla.com
push dateTue, 24 Jul 2018 22:23:10 +0000
treeherdermozilla-inbound@4ae19227350c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1476333
milestone63.0a1
first release with
nightly linux32
dd386b5b9fa7 / 63.0a1 / 20180724223402 / files
nightly linux64
dd386b5b9fa7 / 63.0a1 / 20180724223402 / files
nightly mac
dd386b5b9fa7 / 63.0a1 / 20180724223402 / files
nightly win32
dd386b5b9fa7 / 63.0a1 / 20180724223402 / files
nightly win64
dd386b5b9fa7 / 63.0a1 / 20180724223402 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1476333 - Refer to AppConstants.BROWSER_CHROME_URL to get the browser URL from the frontend;r=Gijs Before this change, we accessed the browser URL in the following ways: - "chrome://browser/content/browser.xul" - "chrome://browser/content/" (which redirects to chrome://browser/content/browser.xul) - Services.prefs.getCharPref("browser.chromeURL") which returns "chrome://browser/content/" - getBrowserURL() from utilityOverlay.js MozReview-Commit-ID: I5vtRke1x9t
accessible/tests/mochitest/browser.js
browser/app/profile/firefox.js
browser/base/content/browser-places.js
browser/base/content/browser.js
browser/base/content/tabbrowser.js
browser/base/content/test/general/browser_bug462673.js
browser/base/content/test/general/browser_fullscreen-window-open.js
browser/base/content/test/general/browser_tab_dragdrop2.js
browser/base/content/test/performance/browser_windowopen.js
browser/base/content/test/static/browser_all_files_referenced.js
browser/base/content/test/webrtc/get_user_media_content_script.js
browser/base/content/utilityOverlay.js
browser/components/customizableui/CustomizableUI.jsm
browser/components/customizableui/test/browser_947914_button_newPrivateWindow.js
browser/components/customizableui/test/browser_947914_button_newWindow.js
browser/components/distribution.js
browser/components/enterprisepolicies/Policies.jsm
browser/components/extensions/parent/ext-windows.js
browser/components/extensions/test/browser/browser_ext_windows.js
browser/components/migration/tests/marionette/test_refresh_firefox.py
browser/components/nsBrowserContentHandler.js
browser/components/nsBrowserGlue.js
browser/components/places/PlacesUIUtils.jsm
browser/components/sessionstore/SessionStore.jsm
browser/components/sessionstore/test/browser_394759_behavior.js
browser/components/sessionstore/test/browser_580512.js
browser/components/sessionstore/test/browser_588426.js
browser/components/sessionstore/test/browser_590563.js
browser/components/sessionstore/test/browser_595601-restore_hidden.js
browser/components/sessionstore/test/browser_659591.js
browser/components/sessionstore/test/browser_701377.js
browser/components/sessionstore/test/head.js
browser/components/syncedtabs/TabListComponent.js
browser/components/syncedtabs/test/xpcshell/test_TabListComponent.js
browser/components/tests/browser/browser_default_bookmark_toolbar_visibility.js
browser/modules/ContentWebRTC.jsm
browser/modules/Sanitizer.jsm
testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
toolkit/components/extensions/parent/ext-identity.js
--- a/accessible/tests/mochitest/browser.js
+++ b/accessible/tests/mochitest/browser.js
@@ -1,8 +1,10 @@
+ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
+
 /**
  * Load the browser with the given url and then invokes the given function.
  */
 function openBrowserWindow(aFunc, aURL, aRect) {
   gBrowserContext.testFunc = aFunc;
   gBrowserContext.startURL = aURL;
   gBrowserContext.browserRect = aRect;
 
@@ -108,17 +110,17 @@ function openBrowserWindowIntl() {
       params += ",top=" + rect.top;
     if ("width" in rect)
       params += ",width=" + rect.width;
     if ("height" in rect)
       params += ",height=" + rect.height;
   }
 
   gBrowserContext.browserWnd =
-    window.openDialog(Services.prefs.getCharPref("browser.chromeURL"),
+    window.openDialog(AppConstants.BROWSER_CHROME_URL,
                       "_blank", params,
                       gBrowserContext.startURL);
 
   whenDelayedStartupFinished(browserWindow(), function() {
     addA11yLoadEvent(startBrowserTests, browserWindow());
   });
 }
 
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -16,17 +16,16 @@
 #
 
 #ifdef XP_UNIX
 #ifndef XP_MACOSX
 #define UNIX_BUT_NOT_MAC
 #endif
 #endif
 
-pref("browser.chromeURL","chrome://browser/content/");
 pref("browser.hiddenWindowChromeURL", "chrome://browser/content/hiddenWindow.xul");
 
 // Enables some extra Extension System Logging (can reduce performance)
 pref("extensions.logging.enabled", false);
 
 // Disables strict compatibility, making addons compatible-by-default.
 pref("extensions.strictCompatibility", false);
 
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -500,17 +500,17 @@ var PlacesCommandHook = {
   },
 
   /**
    * Updates disabled state for the "Bookmark All Tabs" command.
    */
   updateBookmarkAllTabsCommand:
   function PCH_updateBookmarkAllTabsCommand() {
     // There's nothing to do in non-browser windows.
-    if (window.location.href != getBrowserURL())
+    if (window.location.href != AppConstants.BROWSER_CHROME_URL)
       return;
 
     // Disable "Bookmark All Tabs" if there are less than two
     // "unique current pages".
     goSetCommandEnabled("Browser:BookmarkAllTabs",
                         this.uniqueCurrentPages.length >= 2);
   },
 
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2178,18 +2178,18 @@ function BrowserGoHome(aEvent) {
     // homepage, if necessary. Observers are only notified if the homepage
     // becomes the active page.
     Services.obs.notifyObservers(null, "browser-open-homepage-start");
   }
 }
 
 function loadOneOrMoreURIs(aURIString, aTriggeringPrincipal) {
   // we're not a browser window, pass the URI string to a new browser window
-  if (window.location.href != getBrowserURL()) {
-    window.openDialog(getBrowserURL(), "_blank", "all,dialog=no", aURIString);
+  if (window.location.href != AppConstants.BROWSER_CHROME_URL) {
+    window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", "all,dialog=no", aURIString);
     return;
   }
 
   // This function throws for certain malformed URIs, so use exception handling
   // so that we don't disrupt startup
   try {
     gBrowser.loadTabs(aURIString.split("|"), {
       inBackground: false,
@@ -2229,31 +2229,31 @@ function focusAndSelectUrlBar(userInitia
   }
 
   gURLBar.userInitiatedFocus = userInitiatedFocus;
   gURLBar.select();
   gURLBar.userInitiatedFocus = false;
 }
 
 function openLocation() {
-  if (window.location.href == getBrowserURL()) {
+  if (window.location.href == AppConstants.BROWSER_CHROME_URL) {
     focusAndSelectUrlBar(true);
     return;
   }
 
   // If there's an open browser window, redirect the command there.
   let win = getTopWin();
   if (win) {
     win.focus();
     win.openLocation();
     return;
   }
 
   // There are no open browser windows; open a new one.
-  window.openDialog("chrome://browser/content/", "_blank",
+  window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank",
                     "chrome,all,dialog=no", BROWSER_NEW_TAB_URL);
 }
 
 function BrowserOpenTab(event) {
   let where = "tab";
   let relatedToCurrent = false;
 
   if (event) {
@@ -2350,17 +2350,17 @@ function BrowserOpenFileWindow() {
     fp.displayDirectory = gLastOpenDirectory.path;
     fp.open(fpCallback);
   } catch (ex) {
   }
 }
 
 function BrowserCloseTabOrWindow(event) {
   // If we're not a browser window, just close the window.
-  if (window.location.href != getBrowserURL()) {
+  if (window.location.href != AppConstants.BROWSER_CHROME_URL) {
     closeWindow(true);
     return;
   }
 
   // In a multi-select context, close all selected tabs
   if (gBrowser.multiSelectedTabsCount) {
     gBrowser.removeMultiSelectedTabs();
     return;
@@ -3925,31 +3925,31 @@ const BrowserSearch = {
   },
 
   /**
    * Gives focus to the search bar, if it is present on the toolbar, or loads
    * the default engine's search form otherwise. For Mac, opens a new window
    * or focuses an existing window, if necessary.
    */
   webSearch: function BrowserSearch_webSearch() {
-    if (window.location.href != getBrowserURL()) {
+    if (window.location.href != AppConstants.BROWSER_CHROME_URL) {
       var win = getTopWin();
       if (win) {
         // If there's an open browser window, it should handle this command
         win.focus();
         win.BrowserSearch.webSearch();
       } else {
         // If there are no open browser windows, open a new one
         var observer = function(subject, topic, data) {
           if (subject == win) {
             BrowserSearch.webSearch();
             Services.obs.removeObserver(observer, "browser-delayed-startup-finished");
           }
         };
-        win = window.openDialog(getBrowserURL(), "_blank",
+        win = window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank",
                                 "chrome,all,dialog=no", "about:blank");
         Services.obs.addObserver(observer, "browser-delayed-startup-finished");
       }
       return;
     }
 
     let focusUrlBarIfSearchFieldIsNotActive = function(aSearchBar) {
       if (!aSearchBar || document.activeElement != aSearchBar.textbox.inputField) {
@@ -4314,20 +4314,20 @@ function OpenBrowserWindow(options) {
   // set, then extract the current charset menu setting from the current document and use it to
   // initialize the new browser window...
   var win;
   if (window && (wintype == "navigator:browser") && window.content && window.content.document) {
     var DocCharset = window.content.document.characterSet;
     let charsetArg = "charset=" + DocCharset;
 
     // we should "inherit" the charset menu setting in a new window
-    win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no" + extraFeatures, defaultArgs, charsetArg);
+    win = window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", "chrome,all,dialog=no" + extraFeatures, defaultArgs, charsetArg);
   } else {
     // forget about the charset information.
-    win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no" + extraFeatures, defaultArgs);
+    win = window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", "chrome,all,dialog=no" + extraFeatures, defaultArgs);
   }
 
   win.addEventListener("MozAfterPaint", () => {
     TelemetryStopwatch.finish("FX_NEW_WINDOW_MS", telemetryObj);
     if (Services.prefs.getIntPref("browser.startup.page") == 1
         && defaultArgs == HomePage.get()) {
       // A notification for when a user has triggered their homepage. This is used
       // to display a doorhanger explaining that an extension has modified the
@@ -5440,17 +5440,17 @@ nsBrowserAccess.prototype = {
         // referrer like the other loads do?
         var url = aURI ? aURI.spec : "about:blank";
         let features = "all,dialog=no";
         if (isPrivate) {
           features += ",private";
         }
         // Pass all params to openDialog to ensure that "url" isn't passed through
         // loadOneOrMoreURIs, which splits based on "|"
-        newWindow = openDialog(getBrowserURL(), "_blank", features, url, null, null, null);
+        newWindow = openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", features, url, null, null, null);
         break;
       case Ci.nsIBrowserDOMWindow.OPEN_NEWTAB :
         // If we have an opener, that means that the caller is expecting access
         // to the nsIDOMWindow of the opened tab right away. For e10s windows,
         // this means forcing the newly opened browser to be non-remote so that
         // we can hand back the nsIDOMWindow. The XULBrowserWindow.shouldLoadURI
         // will do the job of shuttling off the newly opened browser to run in
         // the right process once it starts loading a URI.
@@ -7412,17 +7412,17 @@ var gPrivateBrowsingUI = {
     if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
       return;
     }
 
     // Disable the Clear Recent History... menu item when in PB mode
     // temporary fix until bug 463607 is fixed
     document.getElementById("Tools:Sanitize").setAttribute("disabled", "true");
 
-    if (window.location.href == getBrowserURL()) {
+    if (window.location.href == AppConstants.BROWSER_CHROME_URL) {
       // Adjust the window's title
       let docElement = document.documentElement;
       if (!PrivateBrowsingUtils.permanentPrivateBrowsing) {
         docElement.setAttribute("title",
           docElement.getAttribute("title_privatebrowsing"));
         docElement.setAttribute("titlemodifier",
           docElement.getAttribute("titlemodifier_privatebrowsing"));
       }
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -3400,17 +3400,17 @@ window._gBrowser = {
     // waiting for the new window to appear.
     // content area when the docshells are swapped.
     if (this.animationsEnabled) {
       aTab.style.maxWidth = ""; // ensure that fade-out transition happens
       aTab.removeAttribute("fadein");
     }
 
     // tell a new window to take the "dropped" tab
-    return window.openDialog(getBrowserURL(), "_blank", options, aTab);
+    return window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", options, aTab);
   },
 
   /**
    * Move contextTab (or selected tabs in a mutli-select context)
    * to a new browser window, unless it is (they are) already the only tab(s)
    * in the current window, in which case this will do nothing.
    */
   replaceTabsWithWindow(contextTab) {
--- a/browser/base/content/test/general/browser_bug462673.js
+++ b/browser/base/content/test/general/browser_bug462673.js
@@ -1,25 +1,25 @@
 add_task(async function() {
-  var win = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no");
+  var win = openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", "chrome,all,dialog=no");
   await SimpleTest.promiseFocus(win);
 
   let tab = win.gBrowser.tabContainer.firstChild;
   await promiseTabLoadEvent(tab, getRootDirectory(gTestPath) + "test_bug462673.html");
 
   is(win.gBrowser.browsers.length, 2, "test_bug462673.html has opened a second tab");
   is(win.gBrowser.selectedTab, tab.nextSibling, "dependent tab is selected");
   win.gBrowser.removeTab(tab);
 
   // Closing a tab will also close its parent chrome window, but async
   await BrowserTestUtils.domWindowClosed(win);
 });
 
 add_task(async function() {
-  var win = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no");
+  var win = openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", "chrome,all,dialog=no");
   await SimpleTest.promiseFocus(win);
 
   let tab = win.gBrowser.tabContainer.firstChild;
   await promiseTabLoadEvent(tab, getRootDirectory(gTestPath) + "test_bug462673.html");
 
   var newTab = win.gBrowser.addTab();
   var newBrowser = newTab.linkedBrowser;
   win.gBrowser.removeTab(tab);
--- a/browser/base/content/test/general/browser_fullscreen-window-open.js
+++ b/browser/base/content/test/general/browser_fullscreen-window-open.js
@@ -246,17 +246,17 @@ function waitForWindowOpen(aOptions) {
 
   let onFinalize = function() {
     aOptions.finalizeFn();
 
     info("Finished: " + message.title);
     runNextTest();
   };
 
-  let listener = new WindowListener(message.title, getBrowserURL(), {
+  let listener = new WindowListener(message.title, AppConstants.BROWSER_CHROME_URL, {
     onSuccess: aOptions.successFn,
     onFinalize,
   });
   Services.wm.addListener(listener);
 
   executeWindowOpenInContent({
     uri: url,
     title: message.title,
@@ -287,17 +287,17 @@ function waitForWindowOpenFromChrome(aOp
 
   let onFinalize = function() {
     aOptions.finalizeFn();
 
     info("Finished: " + message.title);
     runNextTest();
   };
 
-  let listener = new WindowListener(message.title, getBrowserURL(), {
+  let listener = new WindowListener(message.title, AppConstants.BROWSER_CHROME_URL, {
     onSuccess: aOptions.successFn,
     onFinalize,
   });
   Services.wm.addListener(listener);
 
   newWin.open(url, message.title, message.option);
 }
 
--- a/browser/base/content/test/general/browser_tab_dragdrop2.js
+++ b/browser/base/content/test/general/browser_tab_dragdrop2.js
@@ -5,17 +5,17 @@ const URI = ROOT + "browser_tab_dragdrop
 
 // Load the test page (which runs some child popup tests) in a new window.
 // After the tests were run, tear off the tab into a new window and run popup
 // tests a second time. We don't care about tests results, exceptions and
 // crashes will be caught.
 add_task(async function() {
   // Open a new window.
   let args = "chrome,all,dialog=no";
-  let win = window.openDialog(getBrowserURL(), "_blank", args, URI);
+  let win = window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", args, URI);
 
   // Wait until the tests were run.
   await promiseTestsDone(win);
   ok(true, "tests succeeded");
 
   // Create a second tab so that we can move the original one out.
   win.gBrowser.addTab("about:blank", {skipAnimation: true});
 
--- a/browser/base/content/test/performance/browser_windowopen.js
+++ b/browser/base/content/test/performance/browser_windowopen.js
@@ -54,17 +54,17 @@ if (Services.appinfo.OS == "WINNT" || Se
 add_task(async function() {
   // Flushing all caches helps to ensure that we get consistent
   // behaviour when opening a new window, even if windows have been
   // opened in previous tests.
   Services.obs.notifyObservers(null, "startupcache-invalidate");
   Services.obs.notifyObservers(null, "chrome-flush-skin-caches");
   Services.obs.notifyObservers(null, "chrome-flush-caches");
 
-  let win = window.openDialog("chrome://browser/content/", "_blank",
+  let win = window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank",
                               "chrome,all,dialog=no,remote,suppressanimation",
                               "about:home");
 
   let alreadyFocused = false;
   let inRange = (val, min, max) => min <= val && val <= max;
   let expectations = {
     expectedReflows: EXPECTED_REFLOWS,
     frames: {
--- a/browser/base/content/test/static/browser_all_files_referenced.js
+++ b/browser/base/content/test/static/browser_all_files_referenced.js
@@ -575,17 +575,17 @@ add_task(async function checkAllTheFiles
     uri = convertToCodeURI(uri.spec);
     if ((uri.startsWith("chrome://") || uri.startsWith("resource://")) &&
         isDevtools == hasDevtoolsPrefix(uri))
       chromeFiles.push(uri);
   }
 
   if (isDevtools) {
     // chrome://devtools/skin/devtools-browser.css is included from browser.xul
-    gReferencesFromCode.set("chrome://browser/content/browser.xul", null);
+    gReferencesFromCode.set(AppConstants.BROWSER_CHROME_URL, null);
     // devtools' css is currently included from browser.css, see bug 1204810.
     gReferencesFromCode.set("chrome://browser/skin/browser.css", null);
   }
 
   let isUnreferenced = file => {
     if (gExceptionPaths.some(e => file.startsWith(e)))
       return false;
     if (gReferencesFromCode.has(file)) {
--- a/browser/base/content/test/webrtc/get_user_media_content_script.js
+++ b/browser/base/content/test/webrtc/get_user_media_content_script.js
@@ -17,17 +17,17 @@ const kObservedTopics = [
   "recording-window-ended"
 ];
 
 var gObservedTopics = {};
 
 function ignoreEvent(aSubject, aTopic, aData) {
   // With e10s disabled, our content script receives notifications for the
   // preview displayed in our screen sharing permission prompt; ignore them.
-  const kBrowserURL = "chrome://browser/content/browser.xul";
+  const kBrowserURL = AppConstants.BROWSER_CHROME_URL;
   const nsIPropertyBag = Ci.nsIPropertyBag;
   if (aTopic == "recording-device-events" &&
       aSubject.QueryInterface(nsIPropertyBag).getProperty("requestURL") == kBrowserURL) {
     return true;
   }
   if (aTopic == "recording-window-ended") {
     let win = Services.wm.getOuterWindowWithId(aData).top;
     if (win.document.documentURI == kBrowserURL)
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -43,20 +43,16 @@ var gBidiUI = false;
  */
 function isBlankPageURL(aURL) {
   return aURL == "about:blank" ||
          aURL == "about:home" ||
          aURL == "about:welcome" ||
          aURL == BROWSER_NEW_TAB_URL;
 }
 
-function getBrowserURL() {
-  return "chrome://browser/content/browser.xul";
-}
-
 function getTopWin(skipPopups) {
   // If this is called in a browser window, use that window regardless of
   // whether it's the frontmost window, since commands can be executed in
   // background windows (bug 626148).
   if (top.document.documentElement.getAttribute("windowtype") == "navigator:browser" &&
       (!skipPopups || top.toolbar.visible))
     return top;
 
@@ -422,17 +418,17 @@ function openLinkIn(url, where, params) 
               sourceTabBrowser,
               sourceFrameOuterWindowID: params.frameOuterWindowID,
             },
           }, "webNavigation-createdNavigationTarget");
         }
       };
       Services.obs.addObserver(delayedStartupObserver, "browser-delayed-startup-finished");
     }
-    win = Services.ww.openWindow(sourceWindow, getBrowserURL(), null, features, sa);
+    win = Services.ww.openWindow(sourceWindow, AppConstants.BROWSER_CHROME_URL, null, features, sa);
     return;
   }
 
   // We're now committed to loading the link in an existing browser window.
 
   // Raise the target window before loading the URI, since loading it may
   // result in a new frontmost window (e.g. "javascript:window.open('');").
   w.focus();
@@ -842,17 +838,17 @@ function openPreferences(paneID, extraAr
   if (!win) {
     let windowArguments = Cc["@mozilla.org/array;1"]
       .createInstance(Ci.nsIMutableArray);
     let supportsStringPrefURL = Cc["@mozilla.org/supports-string;1"]
       .createInstance(Ci.nsISupportsString);
     supportsStringPrefURL.data = preferencesURL;
     windowArguments.appendElement(supportsStringPrefURL);
 
-    win = Services.ww.openWindow(null, Services.prefs.getCharPref("browser.chromeURL"),
+    win = Services.ww.openWindow(null, AppConstants.BROWSER_CHROME_URL,
       "_blank", "chrome,dialog=no,all", windowArguments);
   } else {
     let shouldReplaceFragment = friendlyCategoryName ? "whenComparingAndReplace" : "whenComparing";
     newLoad = !win.switchToTabHavingURI(preferencesURL, true, {
       ignoreFragment: shouldReplaceFragment,
       replaceQueryString: true,
       triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
     });
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -36,17 +36,17 @@ const kPrefCustomizationState        = "
 const kPrefCustomizationAutoAdd      = "browser.uiCustomization.autoAdd";
 const kPrefCustomizationDebug        = "browser.uiCustomization.debug";
 const kPrefDrawInTitlebar            = "browser.tabs.drawInTitlebar";
 const kPrefExtraDragSpace            = "browser.tabs.extraDragSpace";
 const kPrefUIDensity                 = "browser.uidensity";
 const kPrefAutoTouchMode             = "browser.touchmode.auto";
 const kPrefAutoHideDownloadsButton   = "browser.download.autohideButton";
 
-const kExpectedWindowURL = "chrome://browser/content/browser.xul";
+const kExpectedWindowURL = AppConstants.BROWSER_CHROME_URL;
 
 /**
  * The keys are the handlers that are fired when the event type (the value)
  * is fired on the subview. A widget that provides a subview has the option
  * of providing onViewShowing and onViewHiding event handlers.
  */
 const kSubviewEvents = [
   "ViewShowing",
--- a/browser/components/customizableui/test/browser_947914_button_newPrivateWindow.js
+++ b/browser/components/customizableui/test/browser_947914_button_newPrivateWindow.js
@@ -17,17 +17,17 @@ add_task(async function() {
   let windowWasHandled = false;
   let privateWindow = null;
 
   let observerWindowOpened = {
     observe(aSubject, aTopic, aData) {
       if (aTopic == "domwindowopened") {
         privateWindow = aSubject.QueryInterface(Ci.nsIDOMWindow);
         privateWindow.addEventListener("load", function() {
-          is(privateWindow.location.href, "chrome://browser/content/browser.xul",
+          is(privateWindow.location.href, AppConstants.BROWSER_CHROME_URL,
              "A new browser window was opened");
           ok(PrivateBrowsingUtils.isWindowPrivate(privateWindow), "Window is private");
           windowWasHandled = true;
         }, {once: true});
       }
     }
   };
 
--- a/browser/components/customizableui/test/browser_947914_button_newWindow.js
+++ b/browser/components/customizableui/test/browser_947914_button_newWindow.js
@@ -17,17 +17,17 @@ add_task(async function() {
   let windowWasHandled = false;
   let newWindow = null;
 
   let observerWindowOpened = {
     observe(aSubject, aTopic, aData) {
       if (aTopic == "domwindowopened") {
         newWindow = aSubject.QueryInterface(Ci.nsIDOMWindow);
         newWindow.addEventListener("load", function() {
-          is(newWindow.location.href, "chrome://browser/content/browser.xul",
+          is(newWindow.location.href, AppConstants.BROWSER_CHROME_URL,
              "A new browser window was opened");
           ok(!PrivateBrowsingUtils.isWindowPrivate(newWindow), "Window is not private");
           windowWasHandled = true;
         }, {once: true});
       }
     }
   };
 
--- a/browser/components/distribution.js
+++ b/browser/components/distribution.js
@@ -416,17 +416,17 @@ DistributionCustomizer.prototype = {
         } catch (e) { /* ignore bad prefs and move on */ }
       }
     }
 
     return this._checkCustomizationComplete();
   },
 
   _checkCustomizationComplete: function DIST__checkCustomizationComplete() {
-    const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
+    const BROWSER_DOCURL = AppConstants.BROWSER_CHROME_URL;
 
     if (this._newProfile) {
       let xulStore = Services.xulStore;
 
       try {
         var showPersonalToolbar = Services.prefs.getBoolPref("browser.showPersonalToolbar");
         if (showPersonalToolbar) {
           xulStore.setValue(BROWSER_DOCURL, "PersonalToolbar", "collapsed", "false");
--- a/browser/components/enterprisepolicies/Policies.jsm
+++ b/browser/components/enterprisepolicies/Policies.jsm
@@ -1,30 +1,31 @@
 /* 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";
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
+ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 XPCOMUtils.defineLazyServiceGetter(this, "gXulStore",
                                    "@mozilla.org/xul/xulstore;1",
                                    "nsIXULStore");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AddonManager: "resource://gre/modules/AddonManager.jsm",
   BookmarksPolicies: "resource:///modules/policies/BookmarksPolicies.jsm",
   CustomizableUI: "resource:///modules/CustomizableUI.jsm",
   ProxyPolicies: "resource:///modules/policies/ProxyPolicies.jsm",
   WebsiteFilter: "resource:///modules/policies/WebsiteFilter.jsm",
 });
 
 const PREF_LOGLEVEL           = "browser.policies.loglevel";
-const BROWSER_DOCUMENT_URL    = "chrome://browser/content/browser.xul";
+const BROWSER_DOCUMENT_URL    = AppConstants.BROWSER_CHROME_URL;
 
 XPCOMUtils.defineLazyGetter(this, "log", () => {
   let { ConsoleAPI } = ChromeUtils.import("resource://gre/modules/Console.jsm", {});
   return new ConsoleAPI({
     prefix: "Policies.jsm",
     // tip: set maxLogLevel to "debug" and use log.debug() to create detailed
     // messages during development. See LOG_LEVELS in Console.jsm for details.
     maxLogLevel: "error",
@@ -953,17 +954,17 @@ function blockAboutPage(manager, feature
 }
 
 let ChromeURLBlockPolicy = {
   shouldLoad(contentLocation, loadInfo, mimeTypeGuess) {
     let contentType = loadInfo.externalContentPolicyType;
     if (contentLocation.scheme == "chrome" &&
         contentType == Ci.nsIContentPolicy.TYPE_DOCUMENT &&
         loadInfo.loadingContext &&
-        loadInfo.loadingContext.baseURI == "chrome://browser/content/browser.xul" &&
+        loadInfo.loadingContext.baseURI == AppConstants.BROWSER_CHROME_URL &&
         contentLocation.host != "mochitests") {
       return Ci.nsIContentPolicy.REJECT_REQUEST;
     }
     return Ci.nsIContentPolicy.ACCEPT;
   },
   shouldProcess(contentLocation, loadInfo, mimeTypeGuess) {
     return Ci.nsIContentPolicy.ACCEPT;
   },
--- a/browser/components/extensions/parent/ext-windows.js
+++ b/browser/components/extensions/parent/ext-windows.js
@@ -192,17 +192,17 @@ this.windows = class extends ExtensionAP
             }
           }
 
           let {allowScriptsToClose, url} = createData;
           if (allowScriptsToClose === null) {
             allowScriptsToClose = typeof url === "string" && url.startsWith("moz-extension://");
           }
 
-          let window = Services.ww.openWindow(null, "chrome://browser/content/browser.xul", "_blank",
+          let window = Services.ww.openWindow(null, AppConstants.BROWSER_CHROME_URL, "_blank",
                                               features.join(","), args);
 
           let win = windowManager.getWrapper(window);
           win.updateGeometry(createData);
 
           // TODO: focused, type
 
           return new Promise(resolve => {
--- a/browser/components/extensions/test/browser/browser_ext_windows.js
+++ b/browser/components/extensions/test/browser/browser_ext_windows.js
@@ -1,15 +1,15 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
 add_task(async function testWindowGetAll() {
   let raisedWin = Services.ww.openWindow(
-    null, Services.prefs.getCharPref("browser.chromeURL"), "_blank",
+    null, AppConstants.BROWSER_CHROME_URL, "_blank",
     "chrome,dialog=no,all,alwaysRaised", null);
 
   await TestUtils.topicObserved("browser-delayed-startup-finished",
                                 subject => subject == raisedWin);
 
   let extension = ExtensionTestUtils.loadExtension({
     background: async function() {
       let wins = await browser.windows.getAll();
--- a/browser/components/migration/tests/marionette/test_refresh_firefox.py
+++ b/browser/components/migration/tests/marionette/test_refresh_firefox.py
@@ -219,17 +219,17 @@ class TestFirefoxRefresh(MarionetteTestC
             bookmark => resolve(bookmark ? bookmark.title : ""),
             ex => resolve(ex)
           );
         """, script_args=(self._bookmarkURL,))
         self.assertEqual(titleInBookmarks, self._bookmarkText)
 
     def checkBookmarkToolbarVisibility(self):
         toolbarVisible = self.marionette.execute_script("""
-          const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
+          const BROWSER_DOCURL = AppConstants.BROWSER_CHROME_URL;
           return Services.xulStore.getValue(BROWSER_DOCURL, "PersonalToolbar", "collapsed");
         """)
         self.assertEqual(toolbarVisible, "false")
 
     def checkHistory(self):
         historyResult = self.runAsyncCode("""
           let resolve = arguments[arguments.length - 1];
           PlacesUtils.history.fetch(arguments[0]).then(pageInfo => {
--- a/browser/components/nsBrowserContentHandler.js
+++ b/browser/components/nsBrowserContentHandler.js
@@ -171,17 +171,17 @@ function getPostUpdateOverridePage(defau
  * @param postData (optional)
  *        An nsIInputStream object to use as POST data when loading the provided
  *        url, or null.
  * @param forcePrivate (optional)
  *        Boolean. If set to true, the new window will be a private browsing one.
  */
 function openBrowserWindow(cmdLine, urlOrUrlList, postData = null,
                            forcePrivate = false) {
-  let chromeURL = Services.prefs.getCharPref("browser.chromeURL");
+  let chromeURL = AppConstants.BROWSER_CHROME_URL;
 
   let args;
   if (!urlOrUrlList) {
     // Just pass in the defaultArgs directly
     args = [gBrowserContentHandler.defaultArgs];
   } else if (Array.isArray(urlOrUrlList)) {
     // Passing an nsIArray for the url disables the "|"-splitting behavior.
     let uriArray = Cc["@mozilla.org/array;1"]
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -9,17 +9,17 @@ ChromeUtils.import("resource://gre/modul
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 (function earlyBlankFirstPaint() {
   if (!Services.prefs.getBoolPref("browser.startup.blankWindow", false))
     return;
 
   let store = Services.xulStore;
   let getValue = attr =>
-    store.getValue("chrome://browser/content/browser.xul", "main-window", attr);
+    store.getValue(AppConstants.BROWSER_CHROME_URL, "main-window", attr);
   let width = getValue("width");
   let height = getValue("height");
 
   // The clean profile case isn't handled yet. Return early for now.
   if (!width || !height)
     return;
 
   let screenX = getValue("screenX");
@@ -1785,17 +1785,17 @@ BrowserGlue.prototype = {
   /**
    * Uncollapses PersonalToolbar if its collapsed status is not
    * persisted, and user customized it or changed default bookmarks.
    *
    * If the user does not have a persisted value for the toolbar's
    * "collapsed" attribute, try to determine whether it's customized.
    */
   _maybeToggleBookmarkToolbarVisibility() {
-    const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
+    const BROWSER_DOCURL = AppConstants.BROWSER_CHROME_URL;
     const NUM_TOOLBAR_BOOKMARKS_TO_UNHIDE = 3;
     let xulStore = Services.xulStore;
 
     if (!xulStore.hasValue(BROWSER_DOCURL, "PersonalToolbar", "collapsed")) {
       // We consider the toolbar customized if it has more than NUM_TOOLBAR_BOOKMARKS_TO_UNHIDE
       // children, or if it has a persisted currentset value.
       let toolbarIsCustomized = xulStore.hasValue(BROWSER_DOCURL, "PersonalToolbar", "currentset");
       let getToolbarFolderCount = () => {
@@ -1811,17 +1811,17 @@ BrowserGlue.prototype = {
     }
   },
 
   // eslint-disable-next-line complexity
   _migrateUI: function BG__migrateUI() {
     // Use an increasing number to keep track of the current migration state.
     // Completely unrelated to the current Firefox release number.
     const UI_VERSION = 69;
-    const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
+    const BROWSER_DOCURL = AppConstants.BROWSER_CHROME_URL;
 
     let currentUIVersion;
     if (Services.prefs.prefHasUserValue("browser.migration.version")) {
       currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
     } else {
       // This is a new profile, nothing to migrate.
       Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
 
@@ -2362,17 +2362,17 @@ BrowserGlue.prototype = {
     let chromeWindow = BrowserWindowTracker.getTopWindow();
     chromeWindow.openPreferences(...args);
   },
 
   _openURLInNewWindow(url) {
     let urlString = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
     urlString.data = url;
     return new Promise(resolve => {
-      let win = Services.ww.openWindow(null, Services.prefs.getCharPref("browser.chromeURL"),
+      let win = Services.ww.openWindow(null, AppConstants.BROWSER_CHROME_URL,
                                        "_blank", "chrome,all,dialog=no", urlString);
       win.addEventListener("load", () => { resolve(win); }, {once: true});
     });
   },
 
   /**
    * Called as an observer when Sync's "display URIs" notification is fired.
    *
--- a/browser/components/places/PlacesUIUtils.jsm
+++ b/browser/components/places/PlacesUIUtils.jsm
@@ -600,17 +600,17 @@ var PlacesUIUtils = {
                 browserWindow.whereToOpenLink(aEvent, false, true) : "window";
     if (where == "window") {
       // There is no browser window open, thus open a new one.
       var uriList = PlacesUtils.toISupportsString(urls.join("|"));
       var args = Cc["@mozilla.org/array;1"].
                   createInstance(Ci.nsIMutableArray);
       args.appendElement(uriList);
       browserWindow = Services.ww.openWindow(aWindow,
-                                             "chrome://browser/content/browser.xul",
+                                             AppConstants.BROWSER_CHROME_URL,
                                              null, "chrome,dialog=no,all", args);
       return;
     }
 
     var loadInBackground = where == "tabshifted";
     // For consistency, we want all the bookmarks to open in new tabs, instead
     // of having one of them replace the currently focused tab.  Hence we call
     // loadTabs with aReplace set to false.
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -4384,17 +4384,17 @@ var SessionStoreInternal = {
         features += "," + aFeature + "=" + winState[aFeature];
     });
 
     if (winState.isPrivate) {
       features += ",private";
     }
 
     var window =
-      Services.ww.openWindow(null, this._prefBranch.getCharPref("chromeURL"),
+      Services.ww.openWindow(null, AppConstants.BROWSER_CHROME_URL,
                              "_blank", features, argString);
 
     this._updateWindowRestoreState(window, aState);
     WINDOW_SHOWING_PROMISES.set(window, PromiseUtils.defer());
 
     return window;
   },
 
--- a/browser/components/sessionstore/test/browser_394759_behavior.js
+++ b/browser/components/sessionstore/test/browser_394759_behavior.js
@@ -22,17 +22,17 @@
 function testWindows(windowsToOpen, expectedResults) {
   return (async function() {
     for (let winData of windowsToOpen) {
       let features = "chrome,dialog=no," +
                      (winData.isPopup ? "all=no" : "all");
       let url = "http://example.com/?window=" + windowsToOpen.length;
 
       let openWindowPromise = BrowserTestUtils.waitForNewWindow({url});
-      openDialog(getBrowserURL(), "", features, url);
+      openDialog(AppConstants.BROWSER_CHROME_URL, "", features, url);
       let win = await openWindowPromise;
       await BrowserTestUtils.closeWindow(win);
     }
 
     let closedWindowData = JSON.parse(ss.getClosedWindowData());
     let numPopups = closedWindowData.filter(function(el, i, arr) {
       return el.isPopup;
     }).length;
--- a/browser/components/sessionstore/test/browser_580512.js
+++ b/browser/components/sessionstore/test/browser_580512.js
@@ -47,17 +47,17 @@ function checkSecondWin(win) {
     finish();
   });
 }
 
 function openWinWithCb(cb, argURIs, expectedURIs) {
   if (!expectedURIs)
     expectedURIs = argURIs;
 
-  var win = openDialog(getBrowserURL(), "_blank",
+  var win = openDialog(AppConstants.BROWSER_CHROME_URL, "_blank",
                        "chrome,all,dialog=no", argURIs.join("|"));
 
   win.addEventListener("load", function() {
     info("the window loaded");
 
     var expectedLoads = expectedURIs.length;
 
     win.gBrowser.addTabsProgressListener({
--- a/browser/components/sessionstore/test/browser_588426.js
+++ b/browser/components/sessionstore/test/browser_588426.js
@@ -19,17 +19,17 @@ function test() {
     is(tab.linkedBrowser.currentURI.spec, "about:mozilla", "visible tab is about:mozilla");
 
     finish();
   });
 }
 
 function newWindowWithState(state, callback) {
   let opts = "chrome,all,dialog=no,height=800,width=800";
-  let win = window.openDialog(getBrowserURL(), "_blank", opts);
+  let win = window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", opts);
 
   win.addEventListener("load", function() {
     executeSoon(function() {
       win.addEventListener("SSWindowStateReady", function() {
         promiseTabRestored(win.gBrowser.tabs[0]).then(() => callback(win));
       }, {once: true});
 
       ss.setWindowState(win, JSON.stringify(state), true);
--- a/browser/components/sessionstore/test/browser_590563.js
+++ b/browser/components/sessionstore/test/browser_590563.js
@@ -53,17 +53,17 @@ async function middleClickTest(win) {
      "The total number of tabs should be 3 after restoring 2 tabs by middle click.");
   is(win.gBrowser.visibleTabs.length, 3,
      "The total number of visible tabs should be 3 after restoring 2 tabs by middle click");
   finish();
 }
 
 function newWindowWithState(state, callback) {
   let opts = "chrome,all,dialog=no,height=800,width=800";
-  let win = window.openDialog(getBrowserURL(), "_blank", opts);
+  let win = window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", opts);
 
   win.addEventListener("load", function() {
     // The form data will be restored before SSTabRestored, so we want to listen
     // for that on the currently selected tab
     let onSSTabRestored = event => {
       let tab = event.target;
       if (tab.selected) {
         win.gBrowser.tabContainer.removeEventListener("SSTabRestored", onSSTabRestored, true);
--- a/browser/components/sessionstore/test/browser_595601-restore_hidden.js
+++ b/browser/components/sessionstore/test/browser_595601-restore_hidden.js
@@ -94,17 +94,17 @@ var TabsProgressListener = {
 
     return [needsRestore, isRestoring];
   }
 };
 
 // ----------
 function newWindowWithState(state, callback) {
   let opts = "chrome,all,dialog=no,height=800,width=800";
-  let win = window.openDialog(getBrowserURL(), "_blank", opts);
+  let win = window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", opts);
 
   registerCleanupFunction(() => BrowserTestUtils.closeWindow(win));
 
   whenWindowLoaded(win, function onWindowLoaded(aWin) {
     TabsProgressListener.init(aWin);
     TabsProgressListener.setCallback(callback);
 
     ss.setWindowState(aWin, JSON.stringify(state), true);
--- a/browser/components/sessionstore/test/browser_659591.js
+++ b/browser/components/sessionstore/test/browser_659591.js
@@ -18,14 +18,14 @@ function test() {
     BrowserTestUtils.closeWindow(win).then(() => {
       waitForFocus(finish);
     });
   });
 }
 
 function newWindow(callback) {
   let opts = "chrome,all,dialog=no,height=800,width=800";
-  let win = window.openDialog(getBrowserURL(), "_blank", opts);
+  let win = window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", opts);
 
   win.addEventListener("load", function() {
     executeSoon(() => callback(win));
   }, {once: true});
 }
--- a/browser/components/sessionstore/test/browser_701377.js
+++ b/browser/components/sessionstore/test/browser_701377.js
@@ -25,17 +25,17 @@ function test() {
 
     finish();
   });
 }
 
 // ----------
 function newWindowWithState(aState, aCallback) {
   let opts = "chrome,all,dialog=no,height=800,width=800";
-  let win = window.openDialog(getBrowserURL(), "_blank", opts);
+  let win = window.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank", opts);
 
   registerCleanupFunction(() => BrowserTestUtils.closeWindow(win));
 
   whenWindowLoaded(win, function onWindowLoaded(aWin) {
     ss.setWindowState(aWin, JSON.stringify(aState), true);
     executeSoon(() => aCallback(aWin));
   });
 }
--- a/browser/components/sessionstore/test/head.js
+++ b/browser/components/sessionstore/test/head.js
@@ -52,17 +52,17 @@ Cc["@mozilla.org/browser/clh;1"].getServ
 
 function provideWindow(aCallback, aURL, aFeatures) {
   function callbackSoon(aWindow) {
     executeSoon(function executeCallbackSoon() {
       aCallback(aWindow);
     });
   }
 
-  let win = openDialog(getBrowserURL(), "", aFeatures || "chrome,all,dialog=no", aURL || "about:blank");
+  let win = openDialog(AppConstants.BROWSER_CHROME_URL, "", aFeatures || "chrome,all,dialog=no", aURL || "about:blank");
   whenWindowLoaded(win, function onWindowLoaded(aWin) {
     if (!aURL) {
       info("Loaded a blank window.");
       callbackSoon(aWin);
       return;
     }
 
     aWin.gBrowser.selectedBrowser.addEventListener("load", function() {
@@ -438,17 +438,17 @@ function whenNewWindowLoaded(aOptions, a
   let features = "";
   let url = "about:blank";
 
   if (aOptions && aOptions.private || false) {
     features = ",private";
     url = "about:privatebrowsing";
   }
 
-  let win = openDialog(getBrowserURL(), "", "chrome,all,dialog=no" + features, url);
+  let win = openDialog(AppConstants.BROWSER_CHROME_URL, "", "chrome,all,dialog=no" + features, url);
   let delayedStartup = promiseDelayedStartupFinished(win);
 
   let browserLoaded = new Promise(resolve => {
     if (url == "about:blank") {
       resolve();
       return;
     }
 
--- a/browser/components/syncedtabs/TabListComponent.js
+++ b/browser/components/syncedtabs/TabListComponent.js
@@ -114,17 +114,17 @@ TabListComponent.prototype = {
     this._window.openTrustedLinkIn(url, where, params);
   },
 
   onOpenTabs(urls, where) {
     if (!OpenInTabsUtils.confirmOpenInTabs(urls.length, this._window)) {
       return;
     }
     if (where == "window") {
-      this._window.openDialog(this._window.getBrowserURL(), "_blank",
+      this._window.openDialog(this._window.AppConstants.BROWSER_CHROME_URL, "_blank",
                               "chrome,dialog=no,all", urls.join("|"));
     } else {
       let loadInBackground = where == "tabshifted";
       this._getChromeWindow(this._window).gBrowser.loadTabs(urls, {
         inBackground: loadInBackground,
         replace: false,
         triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
       });
--- a/browser/components/syncedtabs/test/xpcshell/test_TabListComponent.js
+++ b/browser/components/syncedtabs/test/xpcshell/test_TabListComponent.js
@@ -82,17 +82,16 @@ add_task(async function testActions() {
   };
   let windowMock = {
     top: {
       PlacesCommandHook: {
         bookmarkLink() { return Promise.resolve(); }
       },
       PlacesUtils: { bookmarksMenuFolderId: "id" }
     },
-    getBrowserURL() {},
     openDialog() {},
     openTrustedLinkIn() {}
   };
   let component = new TabListComponent({
     window: windowMock, store, View: null, SyncedTabs,
     clipboardHelper: clipboardHelperMock,
     getChromeWindow: getChromeWindowMock });
 
--- a/browser/components/tests/browser/browser_default_bookmark_toolbar_visibility.js
+++ b/browser/components/tests/browser/browser_default_bookmark_toolbar_visibility.js
@@ -3,16 +3,16 @@
 
 /**
  * Test _maybeToggleBookmarkToolbarVisibility() code running for new profiles.
  * Ensure that the bookmarks toolbar is hidden in a default configuration.
  * If new default bookmarks are added to the toolbar then the threshold of > 3
  * in NUM_TOOLBAR_BOOKMARKS_TO_UNHIDE may need to be adjusted there.
  */
 add_task(async function test_default_bookmark_toolbar_visibility() {
-  const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
+  const BROWSER_DOCURL = AppConstants.BROWSER_CHROME_URL;
   let xulStore = Services.xulStore;
 
   is(xulStore.getValue(BROWSER_DOCURL, "PersonalToolbar", "collapsed"), "",
      "Check that @collapsed isn't persisted");
   ok(document.getElementById("PersonalToolbar").collapsed,
      "The bookmarks toolbar should be collapsed by default");
 });
--- a/browser/modules/ContentWebRTC.jsm
+++ b/browser/modules/ContentWebRTC.jsm
@@ -3,21 +3,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 var EXPORTED_SYMBOLS = [ "ContentWebRTC" ];
 
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
+ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 XPCOMUtils.defineLazyServiceGetter(this, "MediaManagerService",
                                    "@mozilla.org/mediaManagerService;1",
                                    "nsIMediaManagerService");
 
-const kBrowserURL = "chrome://browser/content/browser.xul";
+const kBrowserURL = AppConstants.BROWSER_CHROME_URL;
 
 var ContentWebRTC = {
   // Called only for 'unload' to remove pending gUM prompts in reloaded frames.
   handleEvent(aEvent) {
     let contentWindow = aEvent.target.defaultView;
     let mm = getMessageManagerForWindow(contentWindow);
     for (let key of contentWindow.pendingGetUserMediaRequests.keys()) {
       mm.sendAsyncMessage("webrtc:CancelRequest", key);
--- a/browser/modules/Sanitizer.jsm
+++ b/browser/modules/Sanitizer.jsm
@@ -492,17 +492,17 @@ var Sanitizer = {
         let refObj = {};
         TelemetryStopwatch.start("FX_SANITIZE_OPENWINDOWS", refObj);
 
         // First create a new window. We do this first so that on non-mac, we don't
         // accidentally close the app by closing all the windows.
         let handler = Cc["@mozilla.org/browser/clh;1"].getService(Ci.nsIBrowserHandler);
         let defaultArgs = handler.defaultArgs;
         let features = "chrome,all,dialog=no," + privateStateForNewWindow;
-        let newWindow = existingWindow.openDialog("chrome://browser/content/", "_blank",
+        let newWindow = existingWindow.openDialog(AppConstants.BROWSER_CHROME_URL, "_blank",
                                                   features, defaultArgs);
 
         let onFullScreen = null;
         if (AppConstants.platform == "macosx") {
           onFullScreen = function(e) {
             newWindow.removeEventListener("fullscreen", onFullScreen);
             let docEl = newWindow.document.documentElement;
             let sizemode = docEl.getAttribute("sizemode");
--- a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
+++ b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm
@@ -748,17 +748,17 @@ var BrowserTestUtils = {
       features += `,${remoteState}`;
     }
 
     if (options.url) {
       argString.data = options.url;
     }
 
     let win = Services.ww.openWindow(
-      opener, Services.prefs.getCharPref("browser.chromeURL"), "_blank",
+      opener, AppConstants.BROWSER_CHROME_URL, "_blank",
       features, argString);
 
     // Wait for browser-delayed-startup-finished notification, it indicates
     // that the window has loaded completely and is ready to be used for
     // testing.
     let startupPromise =
       TestUtils.topicObserved("browser-delayed-startup-finished",
                               subject => subject == win).then(() => win);
--- a/toolkit/components/extensions/parent/ext-identity.js
+++ b/toolkit/components/extensions/parent/ext-identity.js
@@ -47,17 +47,17 @@ const checkRedirected = (url, redirectUR
 const openOAuthWindow = (details, redirectURI) => {
   let args = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
   let supportsStringPrefURL = Cc["@mozilla.org/supports-string;1"]
                                 .createInstance(Ci.nsISupportsString);
   supportsStringPrefURL.data = details.url;
   args.appendElement(supportsStringPrefURL);
 
   let window = Services.ww.openWindow(null,
-                                      Services.prefs.getCharPref("browser.chromeURL"),
+                                      AppConstants.BROWSER_CHROME_URL,
                                       "launchWebAuthFlow_dialog",
                                       "chrome,location=yes,centerscreen,dialog=no,resizable=yes,scrollbars=yes",
                                       args);
 
   return new Promise((resolve, reject) => {
     let wpl;
 
     // If the user just closes the window we need to reject