webextensions-examples icon indicating copy to clipboard operation
webextensions-examples copied to clipboard

Manifest v3 examples needed

Open erosman opened this issue 2 years ago • 6 comments

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

erosman avatar Aug 02 '22 15:08 erosman

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

GeorgeDaris avatar Aug 03 '22 12:08 GeorgeDaris

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

notshriram avatar Mar 23 '23 14:03 notshriram

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.

Huluk avatar Apr 30 '23 12:04 Huluk

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)

Rob--W avatar May 17 '23 16:05 Rob--W

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

ianustec avatar Jan 15 '24 08:01 ianustec

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.

Rob--W avatar Apr 19 '24 14:04 Rob--W