hoppscotch / hoppscotch-extension

🧩 Browser extensions to provide more capabilities to https://hoppscotch.io
https://hoppscotch.io
MIT License
254 stars 95 forks source link

chore: firefox manifest v3 support #232

Closed amk-dev closed 10 months ago

amk-dev commented 1 year ago

Changes

  1. Split the combined manifest into 3 files

    • manifest.common.json - contains the common manifest fields for chrome and firefox
    • manifest.firefox.json - contains the firefox specific manifest fields
    • manifest.chrome.json - contains the chrome specific manifest fields
  2. Create a parcel reporter plugin to merge the manifests. ( the merging is super simple right now, and doesnt support merging nested objects ) at the end of a successful build

  3. Remove 'build' command from the package.json, and introduce a build:chrome and build:firefox commands

  4. Update the hookContent injecting mechanism for firefox

    • Our current implementation uses the new scripting api, with WORLD set to MAIN. the reason for implementing this is described in #186. but firefox is yet to implement this.

    • But firefox does not constraint content-scripts with access to extension apis to not access the pages document. ( chrome does this, see #186). So for now we can use the old method of injecting the content script for firefox. when firefox supports the new api & security model, we can switch to the same implementation as chrome.