-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix: mv2 firefox csp header #27770
fix: mv2 firefox csp header #27770
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Quality Gate failedFailed conditions |
75e16be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me overall. Has anyone manually tested with a prod-like build?
Builds ready [cec02cb]
Page Load Metrics (2095 ± 90 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@danjm I manually tested it today with a prod-like build using the command:
it worked for me locally. |
Hey @itsyoboieltr I used the build from bot above and tested locally the zip in firefox. I noticed that in firefox page we won't receive any errors, while in extension log we still have it, is this expected? |
Hi @DDDDDanica, thank you for checking out and testing the PR! The error logs in the extension are unrelated to the issue. This PR is about fixing the CSP error messages for websites (not the extension itself). The screenshot you sent seems to be showing a pre-existing error. I could reproduce the same error messages in the console by running the current build from develop. |
@itsyoboieltr thanks for the explanation, just to make sure it is not related, approve now ! |
Description
This PR implements a workaround for a long-standing Firefox MV2 bug where the content-security-policy header is not bypassed, triggering an error.
The solution is simple: we check if the extension is MV2 running in Firefox. If yes, we override the header to prevent the error from raising.
Related issues
Fixes: #3133, https://github.com/MetaMask/MetaMask-planning/issues/3342
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist