Fix popup communication on Firefox

This commit is contained in:
Ajay
2022-06-02 18:47:03 -04:00
parent 5820758563
commit 96173dd901
2 changed files with 18 additions and 3 deletions

View File

@@ -84,7 +84,20 @@ chrome.runtime.onMessage.addListener(function (request, _, callback) {
case "unregisterContentScript":
unregisterFirefoxContentScript(request.id)
return false;
}
case "tabs":
chrome.tabs.query({
active: true,
currentWindow: true
}, tabs => {
chrome.tabs.sendMessage(
tabs[0].id,
request.data,
(response) => callback(response)
);
}
);
return true;
}
});
//add help page on install