fix(browser): isolate script URLs with empty query or fragment (#2074)

This commit is contained in:
xin zhuang
2026-10-12 14:56:51 +08:00
committed by GitHub
parent 98d8470d36
commit 9b780c47bc
3 changed files with 46 additions and 2 deletions
+3 -2
View File
@@ -94,8 +94,9 @@ const candidatePath = (script: CapturedWebScript): CandidatePath => {
return {
path: `origins/${hash(url.origin)}/${parts.join("/")}`,
reason:
url.search !== "" ||
url.hash !== "" ||
// URL.search/hash collapse absent and explicitly empty components.
url.href.includes("?") ||
url.href.includes("#") ||
url.username !== "" ||
url.password !== ""
? "URL query, fragment, or credentials cannot select a canonical local module."