19 lines
907 B
JavaScript
19 lines
907 B
JavaScript
const fs = require('fs')
|
|
const html = fs.readFileSync('D:/Sites/Skinbase26/skinbase.top-20260429T075355.html', 'utf8')
|
|
const idx = html.indexOf('"requestedUrl"')
|
|
let start = idx; while(start>0 && html[start]!=='{') start--
|
|
let depth=0,end=0
|
|
const slice = html.slice(start)
|
|
for(let i=0;i<slice.length;i++){if(slice[i]==='{')depth++;else if(slice[i]==='}'){depth--;if(depth===0){end=i+1;break}}}
|
|
const lhr = JSON.parse(slice.slice(0,end))
|
|
const audits = ['link-name','color-contrast','label-content-name-mismatch','link-in-text-block','forced-reflow-insight','image-delivery-insight']
|
|
for (const id of audits) {
|
|
const a = lhr.audits[id]
|
|
if (!a) continue
|
|
console.log(`\n=== ${id} (score ${a.score}) ===`)
|
|
;(a.details?.items || []).forEach(item => {
|
|
if (item.type === 'node') console.log(' node:', item.snippet?.slice(0,200))
|
|
else console.log(' item:', JSON.stringify(item).slice(0,300))
|
|
})
|
|
}
|