Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebExtension manifestV3 doesn't work as expected #7997

Closed
sergey-shpak opened this issue Apr 23, 2022 · 2 comments · Fixed by #8000
Closed

WebExtension manifestV3 doesn't work as expected #7997

sergey-shpak opened this issue Apr 23, 2022 · 2 comments · Fixed by #8000

Comments

@sergey-shpak
Copy link
Contributor

sergey-shpak commented Apr 23, 2022

🐛 bug report

Using parcel to build webextension with manifest v3 causing few issues:

  1. web_accessible_resources are not storing initial resource name if it is already used as an action source
  2. all the sources bundled into root dir without any dir paths
  3. manifest schema doesn't allow any additional props (like key for example)

🎛 Configuration (.babelrc, package.json, cli command)

default configuration

no babel config

🤔 Expected Behavior

  1. Storing initial web_accessible_resources names to make them accessible
  2. Preserving paths to sources in resulting bundle
  3. Adding key prop, or allowing additional props in manifest schema

💁 Possible Solution

🔦 Context

💻 WebExtension Manifest Sample

{
  "name": "Test",
  "version": "0.0.0",
  "description": "Test manifest",
  "manifest_version": 3,
  "action": {
    "default_popup": "action.html"
  },
  "web_accessible_resources": [{
    "resources": ["action.html"],
    "matches": ["<all_urls>"]
  }]
}

results in

{
  "name":"Test",
  "version":"0.0.0",
  "description":"Test manifest",
  "manifest_version":3,
  "action":{
    "default_popup":"action.e0bbec54.html"
  },
  "web_accessible_resources":[{
    "resources":["action.e0bbec54.html"],
    "matches":["<all_urls>"]
  }]}

reusing compiled resource without preserving it's initial name is wrong for web_accessible_resources

🌍 Your Environment

Software Version(s)
Parcel 2.5.0.
Node 16
npm/Yarn
Operating System
@101arrowz
Copy link
Member

3 is expected behavior because the schema does not allow manifest keys that are particularly unusual or marked as deprecated. 1 and 2 seem to be issues with needsStableName not changing asset's cache key. I'll try to investigate this soon.

@sergey-shpak
Copy link
Contributor Author

@101arrowz thanks, the key prop is not deprecated and used in development(to preserve extension id), also there are other props that are not in manifest scheme yet, for example optional_host_permissions, so it would be great to allow passing additional properties(at least for commonProps)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants