Closed peterhil closed 1 year ago
Try out WebExtensions polyfill by Mozilla or Web-Extension Polyfill for TypeScript if using Typescript already.
It's also possible to use Promises effectively using two-way messaging. Communication between a background page and a tab content script, for example, looks something like this from the background page side:
browser.tabs.sendMessage(tabId, "get-ids").then(results => { processResults(results); });
Replaced Rosegarden with webextension-polyfill, because Chrome’s new promisified APIs did not work with Rosegarden.
Use webextension-polyfill
Try out WebExtensions polyfill by Mozilla or Web-Extension Polyfill for TypeScript if using Typescript already.
Highlights
Two way messaging
It's also possible to use Promises effectively using two-way messaging. Communication between a background page and a tab content script, for example, looks something like this from the background page side: