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

[ext] Manifest V3 #1912

Merged
merged 3 commits into from
Feb 15, 2024
Merged

[ext] Manifest V3 #1912

merged 3 commits into from
Feb 15, 2024

Conversation

sigmike
Copy link
Collaborator

@sigmike sigmike commented Feb 6, 2024

related issues #1883


Description

This PR implements the changes to support manifest V3. The configure and build commands still produce a manifest V2.

You can produce a manifest V3 version for Chrome with:

EXTENSION_BROWSER=chrome node prepareExtension.js

And for Firefox:

EXTENSION_BROWSER=firefox MANIFEST_VERSION=3 node prepareExtension.js

For Firefox it defaults to manifest V2 because of UX and CORS issues, see #1883 (comment).

If we want to release a manifest V3 version for Chrome the remaining task is to update the build scripts, and we may also want to change the yarn configure commands.

Checklist

  • I added the related issue(s) id in the related issues section (if any)
  • I described my changes and my decisions in the PR description
  • I read the development guidelines of the [CONTRIBUTING.md][development-guidelines]
  • The tests pass and have been updated if relevant
  • The code quality check pass

Since 1accca6 the backend adds a
`Content-Security-Policy` header that overrides the `X-Frame-Options`
header and allows frames from youtube. So this header change would only
be needed for browser that do not support the `frame-ancestors` in
`Content-Security-Policy`, so Chrome < 40 (2015) and Firefox < 58
(2018). I've tested on both Firefox and Chrome and the frame is indeed
allowed if the header change is removed.
The commands `yarn configure`, `yarn configure:dev`, and `build.sh`
still generate the manifest V2 version that is supported by Firefox and
Chrome.
@sigmike sigmike self-assigned this Feb 6, 2024
@sigmike sigmike added the Extension Development of the browser extension label Feb 6, 2024
@GresilleSiffle
Copy link
Collaborator

GresilleSiffle commented Feb 12, 2024

Thank you again @sigmike for all your contributions 👏

The current way Firefox handles the host permissions is indeed quite complex and I'm worried about the UX. I hope it will change in the future (see a related "bug"). To use the manifest v3 version on Firefox, I had to manually enable the permissions for each host from the extension menu, 3 clicks + 1 click per host 😵‍💫 (see the image below).

For our extension to work, those host permissions are required, but it looks like they are optional for Firefox. If for specific reasons we want to publish a manifest v3 version for Firefox in the future, we may need to add an onboarding UI inviting the users to accept the permissions.

On Chromium, the host permissions were accepted by default. Let's not forget to update our GitHub workflow before the end of manifest v2 to build both the Firefox and the Chromium version.

capture

Copy link
Collaborator

@GresilleSiffle GresilleSiffle left a comment

Choose a reason for hiding this comment

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

Good to me 👍

Maybe we can add a section in the README.md, just after the section Prepare the extension, or inside, to explain how to create a manifest v3 version with the commands listed in this PR description.

@GresilleSiffle GresilleSiffle merged commit 8dbf7ad into main Feb 15, 2024
6 checks passed
@GresilleSiffle GresilleSiffle deleted the manifest_v3 branch February 15, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extension Development of the browser extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants