Bug 1340671 - [webext] Fix race in getDevToolsTargetForContext utility method. r?kmag
MozReview-Commit-ID: 82r45FeljAV
--- a/browser/components/extensions/ext-devtools.js
+++ b/browser/components/extensions/ext-devtools.js
@@ -35,16 +35,17 @@ let initDevTools;
* A devtools extension proxy context.
*
* @returns {Promise<TabTarget>}
* The cloned devtools target associated to the context.
*/
global.getDevToolsTargetForContext = (context) => {
return Task.spawn(function* asyncGetTabTarget() {
if (context.devToolsTarget) {
+ yield context.devToolsTarget.makeRemote();
return context.devToolsTarget;
}
if (!context.devToolsToolbox || !context.devToolsToolbox.target) {
throw new Error("Unable to get a TabTarget for a context not associated to any toolbox");
}
if (!context.devToolsToolbox.target.isLocalTab) {