зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1694140 - [devtools] Add getToolboxForTab and closeToolboxForTab helpers on gDevTools r=ochameau
Depends on D105743 Differential Revision: https://phabricator.services.mozilla.com/D105998
This commit is contained in:
Родитель
b0dd175880
Коммит
a49f853e14
|
@ -706,6 +706,20 @@ DevTools.prototype = {
|
|||
return TargetFactory.forTab(tab);
|
||||
},
|
||||
|
||||
/**
|
||||
* Retrieve an existing toolbox for the provided tab if it was created before.
|
||||
* Returns null otherwise.
|
||||
*/
|
||||
async getToolboxForTab(tab) {
|
||||
const target = await this.getTargetForTab(tab);
|
||||
return this._toolboxes.get(target);
|
||||
},
|
||||
|
||||
async closeToolboxForTab(tab) {
|
||||
const target = await this.getTargetForTab(tab);
|
||||
return this.closeToolbox(target);
|
||||
},
|
||||
|
||||
/**
|
||||
* Compatibility layer for web-extensions. Used by DevToolsShim for
|
||||
* browser/components/extensions/ext-devtools.js
|
||||
|
|
Загрузка…
Ссылка в новой задаче