Repository navigation
Conversation
Chrome 158 raises a FencedFrame deprecation issue when window.fence is read, and the parser reads every own property of globalThis to collect its known globals. Skip it the way styleMedia and sharedStorage are skipped, and test that the parser reads none of the three.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The CSP parser reads every own property of
globalThisto build its set of known globals. In Chrome 158 (Canary today, stable on November 17 according to the Chromium schedule), readingwindow.fenceraises aFencedFramedeprecation issue in DevTools → Issues on every page that loads the CSP build. Chrome 155 doesn't report it, and I haven't checked 156 or 157.Lighthouse counts it, so Best Practices drops from 100 to 81. That's the same drop #4787 fixed for
sharedStorage.Solution
Add
"fence"to the skip list next to"styleMedia"and"sharedStorage".Testing
I read the globals the way the parser does, one fresh page per run, and listened for
DeprecationIssueevents over the DevTools protocol:fenceskippedFencedFrameReading the four globals with "fence" in their name one at a time in 158, only
fenceraises it.Fence,FencedFrameConfigandHTMLFencedFrameElementdon't.The new
tests/vitest/csp-globals.spec.jsputs getters onstyleMedia,sharedStorageandfencebefore importing the parser and checks that none of them gets read. It fails onmain, wherefenceis read, and passes with this change.