Repository navigation
Conversation
…not only when no bodies are attached #1430 Signed-off-by: Nik Cubrilovic <[email protected]>
…cript text, quote-aware tag ends; Contentful needs a URL or package form #1430 Signed-off-by: Nik Cubrilovic <[email protected]>
Merged
Contributor
Author
|
Landed in v0.0.149 as nik |
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.
Closes #1430
A
script-urlsignature matched the page HTML only when the page had no script bodies attached. Once bodies were attached, only the listed URLs were tested, so a URL an inline snippet writes (Microsoft Clarity's standard loader) was found only on pages that had run out of byte budget. Detection depended on the caps, not the site.Change
script-urlalways tests the listed script URLs and the page's markup: every tag as written plus the text of each<script>element. One linear pass (pageMarkup), last page cached.script,link,img,iframe,embed,object,sourcetags as written (quote-aware, a>inside an attribute does not end a tag) and the text of JavaScript<script>elements up to 16 KB. Not kept: text between tags, comments,<a>,<meta>, JSON data blocks (JSON-LD,__NEXT_DATA__) and larger inline bundles. This also tightens the old no-bodies fallback, which read the whole HTML including prose.cdn.contentful.com,contentful.js,contentful@), not the bare word.Tests
script-url-inline-1430.test.ts: the standard Clarity snippet plus an attached body is detected, with the same list as without bodies and with an empty script list; a scriptsrcand a stored script URL still match; prose naming clarity.ms or Contentful is not detected either way; a commented-out script is not;pageMarkupkeeps tags and script text, drops prose, handles unterminated tags and stays linear on 200k scripts and 500k<. All tech-detect suites, the CLI tech-detect parity/limits/headers/fit tests and the supabase signature test pass.Docs:
cloud/technologies.mdx(Script URLs). Not measured: the effect on the stored 33k-site corpus (the issue's 24 Clarity and 10 Contentful sites); re-run the offline corpus pass to confirm the Clarity count returns and see which prose-only Contentful matches go.Skill change: none.
nik