зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1566457 - Removed deprecated gDevTools JSM. r=jdescottes
This was kept to support old xul addons. All mozilla-central usages have been removed and now uses Loader.jsm to get access to this module. Differential Revision: https://phabricator.services.mozilla.com/D38321 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
438498ee47
Коммит
040c1a34cc
|
@ -608,9 +608,12 @@ var paymentDialogWrapper = {
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let { gDevToolsBrowser } = ChromeUtils.import(
|
const { require } = ChromeUtils.import(
|
||||||
"resource://devtools/client/framework/gDevTools.jsm"
|
"resource://devtools/shared/Loader.jsm"
|
||||||
);
|
);
|
||||||
|
const {
|
||||||
|
gDevToolsBrowser,
|
||||||
|
} = require("devtools/client/framework/devtools-browser");
|
||||||
gDevToolsBrowser.openContentProcessToolbox({
|
gDevToolsBrowser.openContentProcessToolbox({
|
||||||
selectedBrowser: this.frameWeakRef.get(),
|
selectedBrowser: this.frameWeakRef.get(),
|
||||||
});
|
});
|
||||||
|
|
|
@ -62,12 +62,6 @@ browser/chrome/devtools/skin/images/tool-storage.svg
|
||||||
browser/chrome/devtools/skin/images/tool-styleeditor.svg
|
browser/chrome/devtools/skin/images/tool-styleeditor.svg
|
||||||
browser/chrome/devtools/skin/promisedebugger.css
|
browser/chrome/devtools/skin/promisedebugger.css
|
||||||
browser/chrome/devtools/skin/variables.css
|
browser/chrome/devtools/skin/variables.css
|
||||||
modules/devtools/Console.jsm
|
|
||||||
modules/devtools/Loader.jsm
|
|
||||||
modules/devtools/shared/Console.jsm
|
|
||||||
modules/devtools/shared/Loader.jsm
|
|
||||||
browser/modules/devtools/client/framework/gDevTools.jsm
|
|
||||||
browser/modules/devtools/gDevTools.jsm
|
|
||||||
browser/chrome/icons/default/default16.png
|
browser/chrome/icons/default/default16.png
|
||||||
browser/chrome/icons/default/default32.png
|
browser/chrome/icons/default/default32.png
|
||||||
browser/chrome/icons/default/default48.png
|
browser/chrome/icons/default/default48.png
|
||||||
|
|
|
@ -1,151 +0,0 @@
|
||||||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
|
||||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
|
||||||
/* 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";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This JSM is here to keep some compatibility with existing add-ons.
|
|
||||||
* Please now use the modules:
|
|
||||||
* - devtools/client/framework/devtools for gDevTools
|
|
||||||
* - devtools/client/framework/devtools-browser for gDevToolsBrowser
|
|
||||||
*/
|
|
||||||
|
|
||||||
this.EXPORTED_SYMBOLS = ["gDevTools", "gDevToolsBrowser"];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Do not directly map to the commonjs modules so that callsites of
|
|
||||||
* gDevTools.jsm do not have to do anything to access to the very last version
|
|
||||||
* of the module. The `devtools` and `browser` getter are always going to
|
|
||||||
* retrieve the very last version of the modules.
|
|
||||||
*/
|
|
||||||
Object.defineProperty(this, "require", {
|
|
||||||
get() {
|
|
||||||
const { require } = ChromeUtils.import(
|
|
||||||
"resource://devtools/shared/Loader.jsm"
|
|
||||||
);
|
|
||||||
return require;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
Object.defineProperty(this, "devtools", {
|
|
||||||
get() {
|
|
||||||
return require("devtools/client/framework/devtools").gDevTools;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
Object.defineProperty(this, "browser", {
|
|
||||||
get() {
|
|
||||||
return require("devtools/client/framework/devtools-browser")
|
|
||||||
.gDevToolsBrowser;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gDevTools is a singleton that controls the Firefox Developer Tools.
|
|
||||||
*
|
|
||||||
* It is an instance of a DevTools class that holds a set of tools. It has the
|
|
||||||
* same lifetime as the browser.
|
|
||||||
*/
|
|
||||||
const gDevToolsMethods = [
|
|
||||||
// Used by: - b2g desktop.js
|
|
||||||
// - nsContextMenu
|
|
||||||
// - /devtools code
|
|
||||||
"showToolbox",
|
|
||||||
|
|
||||||
// Used by Addon SDK and /devtools
|
|
||||||
"closeToolbox",
|
|
||||||
"getToolbox",
|
|
||||||
|
|
||||||
// Used by Addon SDK, main.js and tests:
|
|
||||||
"registerTool",
|
|
||||||
"registerTheme",
|
|
||||||
"unregisterTool",
|
|
||||||
"unregisterTheme",
|
|
||||||
|
|
||||||
// Used by main.js and test
|
|
||||||
"getToolDefinitionArray",
|
|
||||||
"getThemeDefinitionArray",
|
|
||||||
|
|
||||||
// Used by WebExtensions devtools API
|
|
||||||
"getTheme",
|
|
||||||
|
|
||||||
// Used by theme-switching.js
|
|
||||||
"getThemeDefinition",
|
|
||||||
"emit",
|
|
||||||
|
|
||||||
// Used by /devtools
|
|
||||||
"on",
|
|
||||||
"off",
|
|
||||||
"once",
|
|
||||||
|
|
||||||
// Used by tests
|
|
||||||
"getToolDefinitionMap",
|
|
||||||
"getThemeDefinitionMap",
|
|
||||||
"getDefaultTools",
|
|
||||||
"getAdditionalTools",
|
|
||||||
"getToolDefinition",
|
|
||||||
];
|
|
||||||
this.gDevTools = {
|
|
||||||
// Used by tests
|
|
||||||
get _toolboxes() {
|
|
||||||
return devtools._toolboxes;
|
|
||||||
},
|
|
||||||
get _tools() {
|
|
||||||
return devtools._tools;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
gDevToolsMethods.forEach(name => {
|
|
||||||
this.gDevTools[name] = (...args) => {
|
|
||||||
return devtools[name].apply(devtools, args);
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gDevToolsBrowser exposes functions to connect the gDevTools instance with a
|
|
||||||
* Firefox instance.
|
|
||||||
*/
|
|
||||||
const gDevToolsBrowserMethods = [
|
|
||||||
// used by browser-sets.inc, command
|
|
||||||
"toggleToolboxCommand",
|
|
||||||
|
|
||||||
// Used by browser.js itself, by setting a oncommand string...
|
|
||||||
"selectToolCommand",
|
|
||||||
|
|
||||||
// Used by browser-sets.inc, command
|
|
||||||
"openAboutDebugging",
|
|
||||||
|
|
||||||
// Used by browser-sets.inc, command
|
|
||||||
"openConnectScreen",
|
|
||||||
|
|
||||||
// Used by browser-sets.inc, command
|
|
||||||
// itself, webide widget
|
|
||||||
"openWebIDE",
|
|
||||||
|
|
||||||
// Used by browser-sets.inc, command
|
|
||||||
"openContentProcessToolbox",
|
|
||||||
|
|
||||||
// Used by browser.js
|
|
||||||
"registerBrowserWindow",
|
|
||||||
|
|
||||||
// Used by devtools-browser.js for the Toggle Toolbox status
|
|
||||||
"hasToolboxOpened",
|
|
||||||
|
|
||||||
// Used by browser.js
|
|
||||||
"forgetBrowserWindow",
|
|
||||||
];
|
|
||||||
this.gDevToolsBrowser = {
|
|
||||||
// Used by webide.js
|
|
||||||
get isWebIDEInitialized() {
|
|
||||||
return browser.isWebIDEInitialized;
|
|
||||||
},
|
|
||||||
// Used by a test (should be removed)
|
|
||||||
get _trackedBrowserWindows() {
|
|
||||||
return browser._trackedBrowserWindows;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
gDevToolsBrowserMethods.forEach(name => {
|
|
||||||
this.gDevToolsBrowser[name] = (...args) => {
|
|
||||||
return browser[name].apply(browser, args);
|
|
||||||
};
|
|
||||||
});
|
|
|
@ -23,7 +23,6 @@ DevToolsModules(
|
||||||
'browser-menus.js',
|
'browser-menus.js',
|
||||||
'devtools-browser.js',
|
'devtools-browser.js',
|
||||||
'devtools.js',
|
'devtools.js',
|
||||||
'gDevTools.jsm',
|
|
||||||
'menu-item.js',
|
'menu-item.js',
|
||||||
'menu.js',
|
'menu.js',
|
||||||
'selection.js',
|
'selection.js',
|
||||||
|
|
|
@ -56,10 +56,10 @@ Example:
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
* File: `/devtools/client/framework/gDevTools.jsm`
|
* File: `/toolkit/mozapps/extensions/AddonManager.jsm`
|
||||||
* Usage (prefer lazy in most cases):
|
* Usage (prefer lazy in most cases):
|
||||||
* `loader.lazyImporter(this, "gDevTools", "resource://devtools/client/framework/gDevTools.jsm")`
|
* `loader.lazyImporter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm")`
|
||||||
* `const { gDevTools } = ChromeUtils.import("resource://devtools/client/framework/gDevTools.jsm")`
|
* `const { AddonManager } = ChromeUtils.import("resource://gre/modules/AddonManager.jsm")`
|
||||||
|
|
||||||
## Chrome Content
|
## Chrome Content
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,6 @@
|
||||||
"FxAccountsStorage.jsm": ["FxAccountsStorageManagerCanStoreField", "FxAccountsStorageManager"],
|
"FxAccountsStorage.jsm": ["FxAccountsStorageManagerCanStoreField", "FxAccountsStorageManager"],
|
||||||
"FxAccountsWebChannel.jsm": ["EnsureFxAccountsWebChannel"],
|
"FxAccountsWebChannel.jsm": ["EnsureFxAccountsWebChannel"],
|
||||||
"fxa_utils.js": ["initializeIdentityWithTokenServerResponse"],
|
"fxa_utils.js": ["initializeIdentityWithTokenServerResponse"],
|
||||||
"gDevTools.jsm": ["gDevTools", "gDevToolsBrowser"],
|
|
||||||
"Geometry.jsm": ["Point", "Rect"],
|
"Geometry.jsm": ["Point", "Rect"],
|
||||||
"Gestures.jsm": ["GestureSettings", "GestureTracker"],
|
"Gestures.jsm": ["GestureSettings", "GestureTracker"],
|
||||||
"GMPInstallManager.jsm": ["GMPInstallManager", "GMPExtractor", "GMPDownloader", "GMPAddon"],
|
"GMPInstallManager.jsm": ["GMPInstallManager", "GMPExtractor", "GMPDownloader", "GMPAddon"],
|
||||||
|
|
Загрузка…
Ссылка в новой задаче