Closed mathieudutour closed 9 months ago
This PR fixes an issue where async listeners would not work:
CS:
listen(async (req, res) => { if (req.name === "getTabURL") { await timeout(1000) res.send(location.href) return } else { res.send("ERROR") } })
BGSW:
await sendToContentScript({ name: "getTabURL" }) // will return undefined
See https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage#sending_an_asynchronous_response_using_sendresponse
Details
This PR fixes an issue where async listeners would not work:
CS:
BGSW:
See https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage#sending_an_asynchronous_response_using_sendresponse
Code of Conduct