mdn / webextensions-examples

Example Firefox add-ons created using the WebExtensions API

Home Page:https://developer.mozilla.org/en-US/Add-ons/WebExtensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Manifest v3 examples needed

erosman opened this issue · comments

New MV3 examples shall be created and added to the current examples.

I was about to ask about this. Can't wait to learn more about mv3.

Still no updates about this? It's been quite some time since support was added for mv3 in firefox.

I wanted to start writing my first Firefox plugin today, but motivation dropped a fair bit when I discovered that there is no documentation for the freshest tech. I spent 3 hours trying to write a v3 manifest so far – no success.

commented

Re-opening. While #526 adds three MV3 examples, we still need more examples to demonstrate the differences between MV2 and MV3, notably in the background key.

PR #526 includes the following parts that are specific to MV3, along with a demo of the declarativeNetRequest API:

  • action (successor to browser_action)
  • host_permissions and how to request them.
  • optional_host_permissions (not implemented in Firefox yet) and optional_permissions.
  • web_accessible_resources (new syntax in MV3).
  • Using the action and options_ui APIs to have a place to run logic other than the background script (since the background key is not cross-browser yet; Chrome and Safari supports background.service_worker, Firefox and Safari supports background.scripts, but there is no key that is supported by all).
  • Not explicitly mentioned in the README, but the examples shows how to easily polyfill browser in MV3 in Chrome (basically globalThis.browser = chrome; when browser is undefined)

Hi Guys,

i've the same issue. I opened an issue for this. No feedback right now.

https://github.com/mdn/webextensions-examples/issues/553

I prepared several MV3 examples with the intend to publish it here, at https://github.com/Rob--W/fosdem-2024-ext/tree/main/code-samples

While they have been referenced in a presentation/webinar, we haven't had the time to prepare MDN articles and publish these samples here.