-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix: Remove LavaMoat policy overrides for Rive animation packages to … #38623
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
base: main
Are you sure you want to change the base?
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. |
|
@metamaskbot update-policies |
✨ Files requiring CODEOWNER review ✨📜 @MetaMask/policy-reviewers (7 files, +28 -61)
Tip Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers. |
|
@MetaMask/policy-reviewers
Security: These are standard, safe browser APIs with no security concerns. They're read-only observation APIs that don't access sensitive data. |
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.
Bug: Browserify build still blocks devicePixelRatio access
The PR removes devicePixelRatio: false overrides to fix Rive animation blur, but this only works for webpack builds where the base policy.json already has devicePixelRatio: true. For the browserify build, the base lavamoat/browserify/main/policy.json has devicePixelRatio: false for both @rive-app/react-canvas>@rive-app/canvas and @rive-app/react-canvas. Simply removing the override won't enable access - the override needs to be changed to devicePixelRatio: true to override the base policy's denial. Without this, the blur fix won't work in browserify-built versions.
lavamoat/browserify/policy-override.json#L65-L89
metamask-extension/lavamoat/browserify/policy-override.json
Lines 65 to 89 in e1f6eab
| }, | |
| "@rive-app/react-canvas>@rive-app/canvas": { | |
| "globals": { | |
| "AudioContext": false, | |
| "DOMMatrix": false, | |
| "FinalizationRegistry": false, | |
| "Iterator": false, | |
| "MouseEvent": false, | |
| "ResizeObserver": false, | |
| "crypto": false, | |
| "define": false, | |
| "h": false, | |
| "importScripts": false, | |
| "location.href": false, | |
| "prompt": false, | |
| "readline": false, | |
| "webkitAudioContext": false, | |
| "fetch": false, | |
| "XMLHttpRequest": false, | |
| "document": false, | |
| "document.createElement": true, | |
| "navigator": false, | |
| "navigator.userAgent": true | |
| } | |
| } |
|
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Builds ready [ead5f88]
UI Startup Metrics (1277 ± 91 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [3372c03]
UI Startup Metrics (1335 ± 106 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
…fix blur issue
Description
Rive animations were appearing blurry in the MetaMask extension UI. This was caused by LavaMoat policy overrides that restricted access to devicePixelRatio and other viewport-related globals for the Rive packages.
This PR removes the unnecessary LavaMoat policy overrides for:
By removing these overrides, the Rive packages can now properly access devicePixelRatio to render animations at the correct resolution for the user's display, preventing blur on high-DPI/Retina screens.
Jira Link: https://consensyssoftware.atlassian.net/browse/SL-370
Changelog
CHANGELOG entry: fixed Blurry Metamask logo in the welcome page
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Grants Rive packages access to devicePixelRatio and key viewport globals and removes restrictive LavaMoat overrides across browserify/webpack configs.
beta,experimental,flask,main):@rive-app/react-canvas>@rive-app/canvas: enabledevicePixelRatio.@rive-app/react-canvas: enableIntersectionObserver,ResizeObserver,innerHeight,innerWidth,matchMedia, anddevicePixelRatio.@rive-app/react-canvasoverrides fromlavamoat/browserify/policy-override.jsonandlavamoat/webpack/{mv2,mv3}/policy-override.json(previously disableddevicePixelRatio,innerHeight,innerWidth,matchMedia, observers, etc.).Written by Cursor Bugbot for commit 3372c03. This will update automatically on new commits. Configure here.