Giter Site home page Giter Site logo

Comments (2)

rubenspgcavalcante avatar rubenspgcavalcante commented on May 31, 2024

No, as the information from the manifest.json is read at the start, as a common file and using the manifest to inform about the content/bg scripts is optional, as you can pass as options to the plugin.
As you can see this plugin don't parses the manifest.json, only read it, on the compilation time (that's why you use it alongside copy-webpack-plugin).
Also added to the docs a way to use multiple manifests.json, depending on your environment (dev or prod). It's a very simple trick that can be used on all plugins on webpack :)

from webpack-extension-reloader.

rhaksw avatar rhaksw commented on May 31, 2024

During extension development I tend to add/remove things from the manifest while I discover what permissions are needed etc. It would be useful to have a mechanism that auto-copies the manifest in the event of such changes, and afterwards auto-reloads the extension in the browser.

Also, regarding dev/prod versions of the manifest, it is easier to maintain one 'base' manifest and modify that on the fly with a script than maintain separate copies. There are more cases than just dev/prod, for example, Firefox requires a manifest key when using storage.sync,

Note that the implementation of storage.sync in Firefox relies on the Add-on ID. If you use storage.sync, you must set an ID for your extension using the applications browser_specific_settings manifest.json key.

Chrome does not support this key and will tell you your manifest is malformed if you include it.

And there are certain browser-specific things that don't look they'll be standardized anytime soon, for example,

  • Chrome's plans to stop supporting the webRequest API (Firefox has not said they will drop the API, nor have they committed to keeping it)
  • Chrome's use of CORB, which prevents content scripts from making cross origin requests (Firefox still allows cross origin requests from content scripts)

These differences may impact what appears in your manifest, so you could potentially have Firefox-dev, Firefox-prod, Chrome-dev, Chrome-prod, etc.

from webpack-extension-reloader.

Related Issues (20)

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.