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

[BUG] MV2 target doesn't support content_security_policy override #154

Closed
2 tasks done
Kurolox opened this issue Aug 26, 2022 · 4 comments · Fixed by #155
Closed
2 tasks done

[BUG] MV2 target doesn't support content_security_policy override #154

Kurolox opened this issue Aug 26, 2022 · 4 comments · Fixed by #155
Assignees
Labels
bug Something isn't working

Comments

@Kurolox
Copy link
Contributor

Kurolox commented Aug 26, 2022

What happened?

When using the --target=firefox-mv2 target for building a Plasmo project, if the package.json file contains a content_security_policy override, the build will fail silently (assumedly due to the different syntax between MV2 and MV3 manifests)

Version

Latest

What OS are you seeing the problem on?

Linux

What browsers are you seeing the problem on?

Firefox

Relevant log output

> plasmo build --target=firefox-mv2

🟣 Plasmo v0.52.1
🟠 The browser extension development framework.
🔵 INFO   | Prepare to bundle the extension...
🔵 INFO   | Loaded env from /home/kuro/tools/hiring/chrome-extension/.env.local
🔴 ERROR  | Invalid Web Extension manifest
          | undefined
🔴 EXIT   | 👋 Good bye and have a great day!

(OPTIONAL) Contact Details

[email protected]

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@Kurolox Kurolox added the bug Something isn't working label Aug 26, 2022
@louisgv louisgv self-assigned this Aug 27, 2022
@louisgv
Copy link
Contributor

louisgv commented Aug 27, 2022

This fix will play nicely with #147

@louisgv louisgv linked a pull request Aug 27, 2022 that will close this issue
3 tasks
@spookyuser
Copy link

This is still happening to me, just wondering if it's on purpose or

@louisgv
Copy link
Contributor

louisgv commented Sep 22, 2023

@spookyuser How are you specifying the CSP override? This code should have passed it down: https://github.com/PlasmoHQ/plasmo/blob/main/cli/plasmo/src/features/manifest-factory/mv2.ts#L65-L87

See if you can fix it - also I'd raise a new issue and referencing this, indicating a regression.

@spookyuser
Copy link

Thanks, will check it out and log a new issue with an example! i think i was just specifying it as "content_security_policy" in the package.json manifest section, and yeah the exported csp had nothing from the ovveride 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants