diff options
Diffstat (limited to 'application/palemoon/base/content/browser.js')
-rw-r--r-- | application/palemoon/base/content/browser.js | 119 |
1 files changed, 6 insertions, 113 deletions
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index 328cc4975..1b9d9b967 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -110,20 +110,6 @@ XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function () { } }); -#ifdef MOZ_DEVTOOLS -XPCOMUtils.defineLazyGetter(this, "DeveloperToolbar", function() { - let tmp = {}; - Cu.import("resource://gre/modules/devtools/DeveloperToolbar.jsm", tmp); - return new tmp.DeveloperToolbar(window, document.getElementById("developer-toolbar")); -}); - -XPCOMUtils.defineLazyGetter(this, "BrowserToolboxProcess", function() { - let tmp = {}; - Cu.import("resource://gre/modules/devtools/ToolboxProcess.jsm", tmp); - return tmp.BrowserToolboxProcess; -}); -#endif - XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs", "resource://gre/modules/PageThumbs.jsm"); @@ -710,6 +696,8 @@ const gXSSObserver = { }; var gBrowserInit = { + delayedStartupFinished: false, + onLoad: function() { gMultiProcessBrowser = gPrefService.getBoolPref("browser.tabs.remote"); @@ -1168,27 +1156,6 @@ var gBrowserInit = { setUrlAndSearchBarWidthForConditionalForwardButton(); }); -#ifdef MOZ_DEVTOOLS - // Enable Chrome Debugger? - let chromeEnabled = gPrefService.getBoolPref("devtools.chrome.enabled"); - let remoteEnabled = chromeEnabled && - gPrefService.getBoolPref("devtools.debugger.chrome-enabled") && - gPrefService.getBoolPref("devtools.debugger.remote-enabled"); - if (remoteEnabled) { - let cmd = document.getElementById("Tools:ChromeDebugger"); - cmd.removeAttribute("disabled"); - cmd.removeAttribute("hidden"); - } - - // Enable Scratchpad in the UI, if the preference allows this. - let scratchpadEnabled = gPrefService.getBoolPref(Scratchpad.prefEnabledName); - if (scratchpadEnabled) { - let cmd = document.getElementById("Tools:Scratchpad"); - cmd.removeAttribute("disabled"); - cmd.removeAttribute("hidden"); - } -#endif - // Enable Error Console? let consoleEnabled = gPrefService.getBoolPref("devtools.errorconsole.enabled"); if (consoleEnabled) { @@ -1206,19 +1173,6 @@ var gBrowserInit = { document.getElementById("appmenu_charsetMenu").hidden = true; #endif -#ifdef MOZ_DEVTOOLS - // Enable Responsive UI? - let responsiveUIEnabled = gPrefService.getBoolPref("devtools.responsiveUI.enabled"); - if (responsiveUIEnabled) { - let cmd = document.getElementById("Tools:ResponsiveUI"); - cmd.removeAttribute("disabled"); - cmd.removeAttribute("hidden"); - } - - // Add Devtools menuitems and listeners - gDevToolsBrowser.registerBrowserWindow(window); -#endif - let appMenuButton = document.getElementById("appmenu-button"); let appMenuPopup = document.getElementById("appmenu-popup"); if (appMenuButton && appMenuPopup) { @@ -1259,6 +1213,8 @@ var gBrowserInit = { setTimeout(function () { BrowserChromeTest.markAsReady(); }, 0); }); + this.delayedStartupFinished = true; + Services.obs.notifyObservers(window, "browser-delayed-startup-finished", ""); }, @@ -1294,15 +1250,6 @@ var gBrowserInit = { if (!this._loadHandled) return; -#ifdef MOZ_DEVTOOLS - gDevToolsBrowser.forgetBrowserWindow(window); - - let desc = Object.getOwnPropertyDescriptor(window, "DeveloperToolbar"); - if (desc && !desc.get) { - DeveloperToolbar.destroy(); - } -#endif - // First clean up services initialized in gBrowserInit.onLoad (or those whose // uninit methods don't depend on the services having been initialized). @@ -6886,20 +6833,9 @@ var TabContextMenu = { }; #ifdef MOZ_DEVTOOLS +// Note: Do not delete! It is used for: base/content/nsContextMenu.js XPCOMUtils.defineLazyModuleGetter(this, "gDevTools", - "resource://gre/modules/devtools/gDevTools.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "gDevToolsBrowser", - "resource://gre/modules/devtools/gDevTools.jsm"); - -Object.defineProperty(this, "HUDService", { - get: function HUDService_getter() { - let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools; - return devtools.require("devtools/webconsole/hudservice").HUDService; - }, - configurable: true, - enumerable: true -}); + "resource://devtools/client/framework/gDevTools.jsm"); #endif // Prompt user to restart the browser in safe mode or normally @@ -6990,49 +6926,6 @@ function toggleAddonBar() { setToolbarVisibility(addonBar, addonBar.collapsed); } -#ifdef MOZ_DEVTOOLS -var Scratchpad = { - prefEnabledName: "devtools.scratchpad.enabled", - - openScratchpad: function SP_openScratchpad() { - return this.ScratchpadManager.openScratchpad(); - } -}; - -XPCOMUtils.defineLazyGetter(Scratchpad, "ScratchpadManager", function() { - let tmp = {}; - Cu.import("resource://gre/modules/devtools/scratchpad-manager.jsm", tmp); - return tmp.ScratchpadManager; -}); - -var ResponsiveUI = { - toggle: function RUI_toggle() { - this.ResponsiveUIManager.toggle(window, gBrowser.selectedTab); - } -}; - -XPCOMUtils.defineLazyGetter(ResponsiveUI, "ResponsiveUIManager", function() { - let tmp = {}; - Cu.import("resource://gre/modules/devtools/responsivedesign.jsm", tmp); - return tmp.ResponsiveUIManager; -}); - -function openEyedropper() { - var eyedropper = new this.Eyedropper(this, { context: "menu", - copyOnSelect: true }); - eyedropper.open(); -} - -Object.defineProperty(this, "Eyedropper", { - get: function() { - let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools; - return devtools.require("devtools/eyedropper/eyedropper").Eyedropper; - }, - configurable: true, - enumerable: true -}); -#endif - XPCOMUtils.defineLazyGetter(window, "gShowPageResizers", function () { #ifdef XP_WIN // Only show resizers on Windows 2000 and XP |