Lusito/webextension-polyfill-ts

Add support for the unified "action" API

mvilrokx opened this issue · 2 comments

Chrome now supports the V3 manifest file which has introduced a new, unified action API in favor of the separate browserAction and pageAction APIs:

https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/#action-api-unification

However, I seem to be unable to use this action API using this tool. This worked fine before I switched to TypeScript (using the POJS version of webextension-polyfill) but I get TS errors when I try to use browser.action.setIcon.

I'm new to TypeScript so not sure if this is an issue in this library or somewhere else but starting here as it started happening when I switched to this library (from webextension-polyfill)

Hmm, this is a tricky problem.. Firefox doesn't seem to support it yet:
https://bugzilla.mozilla.org/show_bug.cgi?id=1687756
https://bugzilla.mozilla.org/show_bug.cgi?id=1706398

Judging from the last issue, this just seems to be an alias for browserAction?
If so I could probably duplicate the types using browserAction and possibly inject an alias during runtime. I haven't checked the entire API yet though.

Fixed in 0.26.0.