diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index faa2591778a4..aa7d71dc2412 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -143,6 +143,18 @@ if (AppConstants.MOZ_CRASHREPORTER) { XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() { return Services.strings.createBundle("chrome://browser/locale/browser.properties"); }); +XPCOMUtils.defineLazyGetter(this, "gNavigatorBundle", function() { + // This is a stringbundle-like interface to gBrowserBundle, formerly a getter for + // the "bundle_browser" element. + return { + getString(key) { + return gBrowserBundle.GetStringFromName(key); + }, + getFormattedString(key, array) { + return gBrowserBundle.formatStringFromName(key, array, array.length); + } + }; +}); XPCOMUtils.defineLazyGetter(this, "gTabBrowserBundle", function() { return Services.strings.createBundle("chrome://browser/locale/tabbrowser.properties"); }); @@ -224,12 +236,11 @@ if (AppConstants.platform != "macosx") { var gEditUIVisible = true; } -/* globals gBrowser, gNavToolbox, gURLBar:true, gNavigatorBundle*/ +/* globals gBrowser, gNavToolbox, gURLBar:true */ [ ["gBrowser", "content"], ["gNavToolbox", "navigator-toolbox"], ["gURLBar", "urlbar"], - ["gNavigatorBundle", "bundle_browser"] ].forEach(function(elementGlobal) { var [name, id] = elementGlobal; Object.defineProperty(window, name, {