samrum / vite-plugin-web-extension

A vite plugin for generating cross browser platform, ES module based web extensions.
MIT License
323 stars 33 forks source link

Add permissions #112

Open oliverkoehler opened 1 year ago

oliverkoehler commented 1 year ago

Hey, i tried to add new permissions to the manifest:

...
"version": "1.0.10",
"manifest_version": 3,
"permissions": [
  "storage"
],

Any suggestions why chrome doesnt recognize?

samrum commented 1 year ago

What problem are you running into?

oliverkoehler commented 1 year ago

The specified rights in the manifest file are not granted. You can test this with the rights: 'storage'.

Message ID: @.*** .com>

andrei-g-git commented 1 year ago

I'm having a related problem, I think, when I add in string permissions to manifest.ts, in the sharedManifest object, I get an incompatible type error from within the getManifest function --- Type 'string' is not assignable to type 'ManifestPermissions'

Looking at the ManifestV3 object, the permissions property is locked for some reason, it's type is never[]

Is there a proper way to add permissions without manually typing them into the dist folder manifest?

samrum commented 1 year ago

@andrei-g-git that's an unrelated issue. Set the type of sharedManifest to Partial<chrome.runtime.ManifestBase>. Fixed in create-vite-plugin-web-extension@2.0.1

samrum commented 1 year ago

@oliverkoehler I'm not able to reproduce any issue with the storage permission. How are you attempting to use the storage API?