Giter Site home page Giter Site logo

Use Manifest v3 for Firefox about hnrelevant HOT 6 CLOSED

imdj avatar imdj commented on June 12, 2024
Use Manifest v3 for Firefox

from hnrelevant.

Comments (6)

imdj avatar imdj commented on June 12, 2024

At the moment, Firefox users wouldn't get a prompt for host_permissions in manifest v3 and instead have to do the following post-install:

  1. Go to about:addons
  2. Click on the extension
  3. Switch to the Permissions tab
  4. Enable the optional permissions required

from hnrelevant.

imdj avatar imdj commented on June 12, 2024

Another options is to programmatically request permissions using browser.permissions.request API from a user action like: browserAction popup

from hnrelevant.

imdj avatar imdj commented on June 12, 2024

For some background:

For reference see:

from hnrelevant.

imdj avatar imdj commented on June 12, 2024

According to this comment made by Tomislav Jovanovic (back in 26/6/2023)

Yes, we're developing an update to the install flow for MV3, that will enable users to choose which host permissions to grant, and the default will be checked (meaning granted) for extensions which ask for a limited number of hosts (likely up to 6-10).

Either way, we still need to handle the case of rejected permissions

from hnrelevant.

imdj avatar imdj commented on June 12, 2024

Note

During initial testing, after all permissions are granted and the extension loaded successfully, fetching results failed with an error that look like this:

Content-Security-Policy: The page’s settings blocked the loading of a resource at https://hn.algolia.com/api/v1/search... (“default-src”).

Turns out we're also required to use background.js for fetch now:

XHR and Fetch

Content scripts can continue using XHR and Fetch by first making requests to background scripts. A background script can then use Fetch to get the data and return the necessary information to the content script. To avoid privacy issues, set the “credentials” option to “omit” and cache option to “no-cache”. In the future, we may offer an API to support the make-request-on-behalf-of-a-document-in-a-tab use case.

https://blog.mozilla.org/addons/2022/10/31/begin-your-mv3-migration-by-implementing-new-features-today/

from hnrelevant.

imdj avatar imdj commented on June 12, 2024

Firefox's manifest v3 is ready.

But, due to to host_permissions being opt-in, which render the extension broken on first install, we'll stick with v2 on the AMO (addons.mozilla.org) listing for now to avoid any friction. Version 0.2.0 still uses manifest v2 but lays the groundwork for a smoother transition in the future by incorporating changes to permissions and using service worker.

from hnrelevant.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.