Skip to content

Add support for Chrome Extension manifest V3 side_panel property.#9178

Merged
mischnic merged 4 commits into
parcel-bundler:v2from
hi-upchen:chrome-extension-sidepanel
Sep 27, 2023
Merged

Add support for Chrome Extension manifest V3 side_panel property.#9178
mischnic merged 4 commits into
parcel-bundler:v2from
hi-upchen:chrome-extension-sidepanel

Conversation

@hi-upchen

Copy link
Copy Markdown
Contributor

↪️ Pull Request

This pull request addresses an issue where the existing web extension plugin did not recognize the side_panel property in Chrome Extension manifest V3, leading to the HTML files not being compiled and copied to the dist folder. With the recent support for the side_panel property in Google Chrome, this PR introduces the necessary changes to enable the plugin to recognize the property, ensuring proper compilation of the HTML files.

The feature aligns with the latest chrome.sidePanel documentation from Chrome, ensuring compliance with the latest standards.

💻 Examples

For the manifest

{
  "manifest_version": 3,
  "name": "Sample Web Extension",
  "version": "0.0.1",
  "background": {
    "service_worker": "service-worker.ts"
  },
  "action": {
    "default_title": "Click to open panel"
  },
  "side_panel": {
    "default_path": "pages/sidepanel/sidepanel.html"
  },
  "permissions": [
    "sidePanel",
    "tabs"
  ],
  "icons": {
    "16": "assets/images/icon-16.png",
    "48": "assets/images/icon-48.png",
    "128": "assets/images/icon-128.png"
  }
}

Before:
The side_panel is not recognized by the @parcel/config-webextension so that the html is not bring to the dist folder.
image

After
With the update, the HTML file for the side_panel settings is now correctly compiled and included in the dist folder.
image

🚨 Test instructions

Integration tests for the new functionality have been added.

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

Comment thread packages/transformers/webextension/src/schema.js

@mischnic mischnic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants