[Bug]: CSP build triggers Chrome "Shared Storage API deprecated" warning #4788
Unanswered
PierreBultez
asked this question in
5. Bugs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
The CSP parser enumerates all
globalThisproperties to build a set of knownglobals. Accessing
window.sharedStoragetriggers Chrome's deprecation warning:This causes Lighthouse "Best Practices" score to drop from 100 to 81.
This is the same class of issue that was already fixed for
styleMedia.Solution
Add
"sharedStorage"to the skip list in the globalThis enumeration loop,alongside the already-skipped
"styleMedia".Testing
sharedStorageis not used by Alpine or typical web appsHow to reproduce
Pre-requisite
Steps
git clone https://github.com/alpinejs/alpine.git alpinejs-bug cd alpinejs-bug npm installnpm run build npx serve .Open Chrome and check :
[Deprecation] Shared Storage API is deprecated and will be removed in a future release.Launch Lighthouse audit :
Expected result
No deprecation warning should appear, because Alpine does not use the Shared Storage API — it only enumerates globals.
Observed result
Chrome detects access to
window.sharedStorageand issues a deprecation warning, lowering the Lighthouse score.Fix proposed in #4787
Beta Was this translation helpful? Give feedback.
All reactions