mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
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:
parent
b0dd175880
commit
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
|
||||
|
Loading…
Reference in New Issue
Block a user