author | Julian Descottes <jdescottes@mozilla.com> |
Tue, 10 Oct 2017 23:21:20 +0200 | |
changeset 386415 | 0f216d29ac806bc6168da2eb516f21b3ff07a0ba |
parent 386414 | f22d51b93cf81f184d3d782429a5ca7bbb1925a4 |
child 386416 | caef338370a531902aea56a36f3c8f9b6e41c501 |
push id | 53373 |
push user | jdescottes@mozilla.com |
push date | Mon, 16 Oct 2017 13:34:02 +0000 |
treeherder | autoland@caef338370a5 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jlast |
bugs | 1407426 |
milestone | 58.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/devtools/client/framework/devtools-browser.js +++ b/devtools/client/framework/devtools-browser.js @@ -358,40 +358,47 @@ var gDevToolsBrowser = exports.gDevTools }); deferred.resolve(target); }); }); return deferred.promise; }, - // Used by menus.js + /** + * Open the Browser Content Toolbox for the provided gBrowser instance. + * Returns a promise that resolves with a toolbox instance. If no content process is + * available, the promise will be rejected and a message will be displayed to the user. + * + * Used by menus.js + */ openContentProcessToolbox(gBrowser) { let { childCount } = Services.ppmm; // Get the process message manager for the current tab let mm = gBrowser.selectedBrowser.messageManager.processMessageManager; let processId = null; for (let i = 1; i < childCount; i++) { let child = Services.ppmm.getChildAt(i); if (child == mm) { processId = i; break; } } if (processId) { - this._getContentProcessTarget(processId) + return this._getContentProcessTarget(processId) .then(target => { // Display a new toolbox, in a new window, with debugger by default return gDevTools.showToolbox(target, "jsdebugger", Toolbox.HostType.WINDOW); }); - } else { - let msg = L10N.getStr("toolbox.noContentProcessForTab.message"); - Services.prompt.alert(null, "", msg); } + + let msg = L10N.getStr("toolbox.noContentProcessForTab.message"); + Services.prompt.alert(null, "", msg); + return Promise.reject(msg); }, /** * Install WebIDE widget */ // Used by itself installWebIDEWidget() { if (this.isWebIDEWidgetInstalled()) {