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

fix: skip snow usage for MV3 test build #19827

Merged
merged 5 commits into from
Jun 30, 2023

Conversation

weizman
Copy link
Member

@weizman weizman commented Jun 29, 2023

This MR introduced the problem, integrates Snow usage with LavaMoat to protect the application.

  • Snow is a browser JS security solution, and therefore it expects the context it tries to defend to have a DOM.
  • In MV3, we no longer have a background context with a DOM, but a service worker that is DOM-less.
  • Therefore, use-snow.js file fails, because it expects window to exist, but in a service worker it doesn't.

The proposed fix is pretty simple, detect runtime execution env is a worker, and if so, skip using Snow.

DDDDDanica
DDDDDanica previously approved these changes Jun 29, 2023
@DDDDDanica DDDDDanica dismissed stale reviews from pedronfigueiredo and themself via f494add June 30, 2023 10:31
@github-actions
Copy link
Contributor

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.

@DDDDDanica DDDDDanica changed the title try fix fix: skip snow usage for MV3 test build Jun 30, 2023
@DDDDDanica DDDDDanica marked this pull request as ready for review June 30, 2023 10:35
@DDDDDanica DDDDDanica requested a review from a team as a code owner June 30, 2023 10:35
@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

Merging #19827 (ad846ab) into develop (4846543) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop   #19827      +/-   ##
===========================================
- Coverage    69.72%   69.72%   -0.01%     
===========================================
  Files          982      982              
  Lines        37045    37045              
  Branches      9935     9935              
===========================================
- Hits         25828    25826       -2     
- Misses       11217    11219       +2     

see 2 files with indirect coverage changes

@DDDDDanica DDDDDanica merged commit a3f8119 into MetaMask:develop Jun 30, 2023
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants