PlasmoHQ / plasmo

🧩 The Browser Extension Framework

Home Page:https://www.plasmo.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[RFC] Manifest override by special target

monkeyWie opened this issue · comments

commented

How do you envision this feature/change to look/work like?

Add manifest_specific configuration to support override the manifest for specific browser targets.

What is the purpose of this change/feature? Why?

For example: my extension needs to declare the webRequestBlocking permission in firefox, but not in chrome, because declaring it in chrome mv3 results in the error

(OPTIONAL) Example implementations

Configuration example:

{
  "manifest": {
    "host_permissions": [
      "http://*/*",
      "https://*/*"
    ],
    "permissions": [
      "downloads",
      "cookies"
    ]
  },
  "manifest_specific":{
    "firefox-mv2": {
      "permissions": [
        "downloads",
        "cookies",
        "webRequest",
        "webRequestBlocking"
      ]
    }
  }
}

Finally firefox-mv2 Firefox get the merged manifest.json:

{
    "host_permissions": [
      "http://*/*",
      "https://*/*"
    ],
    "permissions": [
      "downloads",
      "cookies",
      "webRequest",
      "webRequestBlocking"
    ]
  }

(OPTIONAL) Contribution

  • I would like to contribute to this RFC via a PR

Verify canary release

  • I verified that the issue exists in plasmo canary release

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.

Same issue for me. I want to declare the sidebar_action key which works for firefox but throws an error in chrome:

Screenshot 2024-05-21 at 15 14 52