plasmo icon indicating copy to clipboard operation
plasmo copied to clipboard

[RFC] Manifest override by special target

Open monkeyWie opened this issue 1 year ago • 1 comments

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

  • [X] I would like to contribute to this RFC via a PR

Verify canary release

  • [X] I verified that the issue exists in plasmo canary release

Code of Conduct

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

monkeyWie avatar Apr 20 '24 06:04 monkeyWie

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

zepedr0 avatar May 21 '24 14:05 zepedr0