fix(security): address CodeQL findings in migration candidate

This commit is contained in:
CI Test
2026-10-05 20:48:12 +01:00
parent 4b140043bb
commit 059ac58cff
11 changed files with 351 additions and 18 deletions
+13
View File
@@ -0,0 +1,13 @@
// Runs inside a browser via Playwright evaluate; parsing does not execute code.
function extractThemeBootstrap(html) {
const doc = new DOMParser().parseFromString(html, 'text/html');
const matches = Array.from(doc.querySelectorAll('script:not([src])'))
.map(script => script.textContent)
.filter(code => code.includes('Apply font early'));
if (matches.length !== 1) {
throw new Error(`Expected one early theme bootstrap, found ${matches.length}`);
}
return matches[0];
}
module.exports = { extractThemeBootstrap };