mcp-web-validator 1.3.51 → 1.3.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/README.md +64 -4
- package/dist/audit-history.d.ts +9 -0
- package/dist/audit-history.js +27 -0
- package/dist/audit-history.js.map +1 -1
- package/dist/index.js +2508 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp-bounds.js +8 -3
- package/dist/mcp-bounds.js.map +1 -1
- package/dist/modules/browser-ux/lighthouse-lab-probe.d.ts +21 -0
- package/dist/modules/browser-ux/lighthouse-lab-probe.js +190 -0
- package/dist/modules/browser-ux/lighthouse-lab-probe.js.map +1 -0
- package/dist/modules/browser-ux/lighthouse-lab.d.ts +61 -0
- package/dist/modules/browser-ux/lighthouse-lab.js +98 -0
- package/dist/modules/browser-ux/lighthouse-lab.js.map +1 -0
- package/dist/modules/browser-ux/media-diagnostics.d.ts +41 -0
- package/dist/modules/browser-ux/media-diagnostics.js +183 -0
- package/dist/modules/browser-ux/media-diagnostics.js.map +1 -0
- package/dist/modules/browser-ux/raw-rendered-diff.d.ts +70 -0
- package/dist/modules/browser-ux/raw-rendered-diff.js +262 -0
- package/dist/modules/browser-ux/raw-rendered-diff.js.map +1 -0
- package/dist/modules/browser-ux/raw-rendered-probe.d.ts +17 -0
- package/dist/modules/browser-ux/raw-rendered-probe.js +163 -0
- package/dist/modules/browser-ux/raw-rendered-probe.js.map +1 -0
- package/dist/modules/browser-ux/resource-failures-probe.d.ts +11 -0
- package/dist/modules/browser-ux/resource-failures-probe.js +231 -0
- package/dist/modules/browser-ux/resource-failures-probe.js.map +1 -0
- package/dist/modules/browser-ux/resource-failures.d.ts +79 -0
- package/dist/modules/browser-ux/resource-failures.js +178 -0
- package/dist/modules/browser-ux/resource-failures.js.map +1 -0
- package/dist/modules/browser-ux/viewport-parity-probe.d.ts +5 -0
- package/dist/modules/browser-ux/viewport-parity-probe.js +316 -0
- package/dist/modules/browser-ux/viewport-parity-probe.js.map +1 -0
- package/dist/modules/browser-ux/viewport-parity.d.ts +112 -0
- package/dist/modules/browser-ux/viewport-parity.js +224 -0
- package/dist/modules/browser-ux/viewport-parity.js.map +1 -0
- package/dist/modules/browser-ux/wcag-interactions.d.ts +95 -0
- package/dist/modules/browser-ux/wcag-interactions.js +360 -0
- package/dist/modules/browser-ux/wcag-interactions.js.map +1 -0
- package/dist/modules/change-regression/availability-history-store.d.ts +18 -0
- package/dist/modules/change-regression/availability-history-store.js +168 -0
- package/dist/modules/change-regression/availability-history-store.js.map +1 -0
- package/dist/modules/change-regression/crawler-log-correlation.d.ts +111 -0
- package/dist/modules/change-regression/crawler-log-correlation.js +374 -0
- package/dist/modules/change-regression/crawler-log-correlation.js.map +1 -0
- package/dist/modules/change-regression/google-common-crawler-ip.d.ts +15 -0
- package/dist/modules/change-regression/google-common-crawler-ip.js +129 -0
- package/dist/modules/change-regression/google-common-crawler-ip.js.map +1 -0
- package/dist/modules/change-regression/historical-comparisons.d.ts +120 -0
- package/dist/modules/change-regression/historical-comparisons.js +330 -0
- package/dist/modules/change-regression/historical-comparisons.js.map +1 -0
- package/dist/modules/change-regression/production-change-comparison.d.ts +68 -0
- package/dist/modules/change-regression/production-change-comparison.js +214 -0
- package/dist/modules/change-regression/production-change-comparison.js.map +1 -0
- package/dist/modules/change-regression/regression-alerts.d.ts +73 -0
- package/dist/modules/change-regression/regression-alerts.js +183 -0
- package/dist/modules/change-regression/regression-alerts.js.map +1 -0
- package/dist/modules/change-regression/strict-observation-time.d.ts +7 -0
- package/dist/modules/change-regression/strict-observation-time.js +31 -0
- package/dist/modules/change-regression/strict-observation-time.js.map +1 -0
- package/dist/modules/content-schema/citation-methodology-consistency.d.ts +108 -0
- package/dist/modules/content-schema/citation-methodology-consistency.js +360 -0
- package/dist/modules/content-schema/citation-methodology-consistency.js.map +1 -0
- package/dist/modules/content-schema/competitor-intent-comparison.d.ts +74 -0
- package/dist/modules/content-schema/competitor-intent-comparison.js +185 -0
- package/dist/modules/content-schema/competitor-intent-comparison.js.map +1 -0
- package/dist/modules/content-schema/empty-boilerplate-content.d.ts +36 -0
- package/dist/modules/content-schema/empty-boilerplate-content.js +225 -0
- package/dist/modules/content-schema/empty-boilerplate-content.js.map +1 -0
- package/dist/modules/content-schema/extract-citation-methodology.d.ts +6 -0
- package/dist/modules/content-schema/extract-citation-methodology.js +201 -0
- package/dist/modules/content-schema/extract-citation-methodology.js.map +1 -0
- package/dist/modules/content-schema/extract-competitor-intent.d.ts +2 -0
- package/dist/modules/content-schema/extract-competitor-intent.js +140 -0
- package/dist/modules/content-schema/extract-competitor-intent.js.map +1 -0
- package/dist/modules/content-schema/extract-main-content.d.ts +6 -0
- package/dist/modules/content-schema/extract-main-content.js +33 -0
- package/dist/modules/content-schema/extract-main-content.js.map +1 -0
- package/dist/modules/content-schema/extract-metadata-consistency.d.ts +3 -0
- package/dist/modules/content-schema/extract-metadata-consistency.js +62 -0
- package/dist/modules/content-schema/extract-metadata-consistency.js.map +1 -0
- package/dist/modules/content-schema/extract-product-claims.d.ts +3 -0
- package/dist/modules/content-schema/extract-product-claims.js +58 -0
- package/dist/modules/content-schema/extract-product-claims.js.map +1 -0
- package/dist/modules/content-schema/extract-structured-data.d.ts +3 -0
- package/dist/modules/content-schema/extract-structured-data.js +25 -0
- package/dist/modules/content-schema/extract-structured-data.js.map +1 -0
- package/dist/modules/content-schema/metadata-consistency.d.ts +66 -0
- package/dist/modules/content-schema/metadata-consistency.js +282 -0
- package/dist/modules/content-schema/metadata-consistency.js.map +1 -0
- package/dist/modules/content-schema/product-claims.d.ts +73 -0
- package/dist/modules/content-schema/product-claims.js +195 -0
- package/dist/modules/content-schema/product-claims.js.map +1 -0
- package/dist/modules/content-schema/same-language-duplicates.d.ts +52 -0
- package/dist/modules/content-schema/same-language-duplicates.js +158 -0
- package/dist/modules/content-schema/same-language-duplicates.js.map +1 -0
- package/dist/modules/content-schema/structured-data-validation.d.ts +37 -0
- package/dist/modules/content-schema/structured-data-validation.js +385 -0
- package/dist/modules/content-schema/structured-data-validation.js.map +1 -0
- package/dist/modules/external-metrics/crux-field-probe.d.ts +10 -0
- package/dist/modules/external-metrics/crux-field-probe.js +113 -0
- package/dist/modules/external-metrics/crux-field-probe.js.map +1 -0
- package/dist/modules/external-metrics/crux-field.d.ts +61 -0
- package/dist/modules/external-metrics/crux-field.js +231 -0
- package/dist/modules/external-metrics/crux-field.js.map +1 -0
- package/dist/modules/http-crawl/availability-observations.d.ts +68 -0
- package/dist/modules/http-crawl/availability-observations.js +206 -0
- package/dist/modules/http-crawl/availability-observations.js.map +1 -0
- package/dist/modules/http-crawl/availability-probe.d.ts +8 -0
- package/dist/modules/http-crawl/availability-probe.js +46 -0
- package/dist/modules/http-crawl/availability-probe.js.map +1 -0
- package/dist/modules/http-crawl/crawler-access-probe.d.ts +6 -0
- package/dist/modules/http-crawl/crawler-access-probe.js +79 -0
- package/dist/modules/http-crawl/crawler-access-probe.js.map +1 -0
- package/dist/modules/http-crawl/crawler-access.d.ts +75 -0
- package/dist/modules/http-crawl/crawler-access.js +404 -0
- package/dist/modules/http-crawl/crawler-access.js.map +1 -0
- package/dist/modules/http-crawl/http-delivery-probe.d.ts +3 -0
- package/dist/modules/http-crawl/http-delivery-probe.js +44 -0
- package/dist/modules/http-crawl/http-delivery-probe.js.map +1 -0
- package/dist/modules/http-crawl/http-delivery.d.ts +64 -0
- package/dist/modules/http-crawl/http-delivery.js +273 -0
- package/dist/modules/http-crawl/http-delivery.js.map +1 -0
- package/dist/modules/http-crawl/https-security.d.ts +84 -0
- package/dist/modules/http-crawl/https-security.js +441 -0
- package/dist/modules/http-crawl/https-security.js.map +1 -0
- package/dist/modules/http-crawl/non-html-directives.d.ts +74 -0
- package/dist/modules/http-crawl/non-html-directives.js +353 -0
- package/dist/modules/http-crawl/non-html-directives.js.map +1 -0
- package/dist/modules/http-crawl/redirect-canonical-chains.d.ts +80 -0
- package/dist/modules/http-crawl/redirect-canonical-chains.js +459 -0
- package/dist/modules/http-crawl/redirect-canonical-chains.js.map +1 -0
- package/dist/modules/http-crawl/redirect-canonical-probe.d.ts +6 -0
- package/dist/modules/http-crawl/redirect-canonical-probe.js +83 -0
- package/dist/modules/http-crawl/redirect-canonical-probe.js.map +1 -0
- package/dist/modules/http-crawl/sitemap-inventory-probe.d.ts +8 -0
- package/dist/modules/http-crawl/sitemap-inventory-probe.js +155 -0
- package/dist/modules/http-crawl/sitemap-inventory-probe.js.map +1 -0
- package/dist/modules/http-crawl/sitemap-inventory.d.ts +107 -0
- package/dist/modules/http-crawl/sitemap-inventory.js +557 -0
- package/dist/modules/http-crawl/sitemap-inventory.js.map +1 -0
- package/dist/modules/http-crawl/url-variants.d.ts +86 -0
- package/dist/modules/http-crawl/url-variants.js +379 -0
- package/dist/modules/http-crawl/url-variants.js.map +1 -0
- package/dist/modules/site-architecture/extract-internal-links.d.ts +3 -0
- package/dist/modules/site-architecture/extract-internal-links.js +88 -0
- package/dist/modules/site-architecture/extract-internal-links.js.map +1 -0
- package/dist/modules/site-architecture/extract-multilingual-page.d.ts +2 -0
- package/dist/modules/site-architecture/extract-multilingual-page.js +29 -0
- package/dist/modules/site-architecture/extract-multilingual-page.js.map +1 -0
- package/dist/modules/site-architecture/internal-link-graph-probe.d.ts +7 -0
- package/dist/modules/site-architecture/internal-link-graph-probe.js +116 -0
- package/dist/modules/site-architecture/internal-link-graph-probe.js.map +1 -0
- package/dist/modules/site-architecture/internal-link-graph.d.ts +113 -0
- package/dist/modules/site-architecture/internal-link-graph.js +414 -0
- package/dist/modules/site-architecture/internal-link-graph.js.map +1 -0
- package/dist/modules/site-architecture/internal-link-quality.d.ts +77 -0
- package/dist/modules/site-architecture/internal-link-quality.js +260 -0
- package/dist/modules/site-architecture/internal-link-quality.js.map +1 -0
- package/dist/modules/site-architecture/multilingual-clusters.d.ts +82 -0
- package/dist/modules/site-architecture/multilingual-clusters.js +363 -0
- package/dist/modules/site-architecture/multilingual-clusters.js.map +1 -0
- package/dist/network.d.ts +4 -0
- package/dist/network.js +25 -8
- package/dist/network.js.map +1 -1
- package/dist/presentation.d.ts +53 -0
- package/dist/presentation.js +526 -0
- package/dist/presentation.js.map +1 -1
- package/dist/screenshot.d.ts +2 -1
- package/dist/screenshot.js +4 -2
- package/dist/screenshot.js.map +1 -1
- package/dist/seo-auditor.js +16 -6
- package/dist/seo-auditor.js.map +1 -1
- package/package.json +7 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-parity-probe.js","sourceRoot":"","sources":["../../../src/modules/browser-ux/viewport-parity-probe.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EACL,+BAA+B,GAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EACL,qBAAqB,EAAE,qBAAqB,EAAE,qBAAqB,EACnE,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EACtD,gBAAgB,EAAE,oBAAoB,EAAE,gBAAgB,GAEzD,MAAM,sBAAsB,CAAC;AAE9B,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAC5C,MAAM,gBAAgB,GACpB,oEAAoE;MAClE,4EAA4E,CAAC;AACjF,MAAM,SAAS,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;AACxE,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAU,EAAE;IAC/C,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QAC3B,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,C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,CAAC,KAAK,UAAU,2BAA2B,CAC/C,GAAW,EAAE,OAAO,GAA6B,+BAA+B;IAEhF,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACjE,OAAO,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EACtD,gCAAgC,CAAC,CAAC;AACtC,CAAC","sourcesContent":["/**\n * V09 local-only browser comparator. Same sanitized HTML, separate mobile and\n * desktop pages, fixed viewports, scripts disabled and deny-all transport.\n * Only a native summary may receive Enter/tap; no links or forms activated.\n */\nimport { load } from \"cheerio\";\nimport {\n defaultScreenshotBrowserRuntime, type ScreenshotBrowserRuntime,\n} from \"../../screenshot.js\";\nimport { safeHttpResourceUrl } from \"../http-crawl/non-html-directives.js\";\nimport { fetchGuardedPublicHtml } from \"./raw-rendered-probe.js\";\nimport {\n analyzeViewportParity, MAX_PARITY_HTML_BYTES, MAX_PARITY_BROWSER_MS,\n MOBILE_VIEWPORT, DESKTOP_VIEWPORT, MAX_PARITY_CONTROLS,\n MAX_PARITY_LINKS, MAX_PARITY_TAB_STEPS, MAX_PARITY_WORDS,\n type ViewportEvidence, type ViewportParityReview, type ParityScope,\n} from \"./viewport-parity.js\";\n\nconst DENY_ALL_PROXY = \"http://127.0.0.1:9\";\nconst CONTROL_SELECTOR =\n 'a[href],button,input:not([type=\"hidden\"]),select,textarea,summary,'\n + '[tabindex],[role=\"button\"],[role=\"link\"],[role=\"checkbox\"],[role=\"switch\"]';\nconst textBytes = (s: string) => new TextEncoder().encode(s).byteLength;\nconst normalizedMarkup = (raw: string): string => {\n const $ = load(raw);\n $(\"script\").filter((_, el) => {\n const type = ($(el).attr(\"type\") ?? \"\").split(\";\", 1)[0].trim().toLowerCase();\n // Structured data is inert JSON, not executable JavaScript. Retain it for\n // equivalent mobile/desktop SEO metadata counts.\n return type !== \"application/ld+json\" && type !== \"application/json\";\n }).remove();\n $(\"iframe,frame,frameset,object,embed,portal\").remove();\n $('meta[http-equiv=\"refresh\" i]').remove();\n $(\"*\").each((_, element) => {\n if (!(\"attribs\" in element) || !element.attribs) return;\n for (const name of Object.keys(element.attribs)) {\n if (/^on[a-z]+$/iu.test(name)) $(element).removeAttr(name);\n }\n });\n return $.html();\n};\n\nexport async function inspectViewportParity(\n html: string, pageUrl: string,\n runtime: ScreenshotBrowserRuntime = defaultScreenshotBrowserRuntime,\n scope: ParityScope = \"isolated_supplied_html_viewports\",\n): Promise<ViewportParityReview> {\n if (!safeHttpResourceUrl(pageUrl) || typeof html !== \"string\" ||\n !html.trim() || textBytes(html) > MAX_PARITY_HTML_BYTES) {\n throw new Error(\"Provide one safe public URL label and HTML within the 400 KB byte limit.\");\n }\n const safeMarkup = normalizedMarkup(html);\n if (textBytes(safeMarkup) > MAX_PARITY_HTML_BYTES) {\n throw new Error(\"The normalized HTML exceeded the bounded viewport input size.\");\n }\n let browser: Awaited<ReturnType<ScreenshotBrowserRuntime[\"launch\"]>> | undefined;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let pendingFailure: unknown;\n let blocked = 0;\n try {\n browser = await runtime.launch(DENY_ALL_PROXY);\n timer = setTimeout(() => { void browser?.close().catch(() => {}); },\n MAX_PARITY_BROWSER_MS);\n timer.unref?.();\n const samples: ViewportEvidence[] = [];\n\n for (const [kind, vp] of [\n [\"mobile\", MOBILE_VIEWPORT], [\"desktop\", DESKTOP_VIEWPORT],\n ] as const) {\n const page = await browser.newPage();\n page.setDefaultTimeout(5_000);\n page.setDefaultNavigationTimeout(8_000);\n // Viewports must be configured before HTML is parsed: isMobile affects\n // meta viewport behavior, touch/scale and CSS media query evaluation.\n await page.setViewport({ ...vp });\n await page.setJavaScriptEnabled(false);\n await page.setOfflineMode(true);\n await page.setRequestInterception(true);\n page.on(\"request\", (request) => {\n blocked++;\n void request.abort(\"blockedbyclient\").catch(() => {});\n });\n await page.setContent(safeMarkup, {\n waitUntil: \"domcontentloaded\", timeout: 8_000,\n });\n const snapshot: ViewportEvidence = await page.evaluate((\n url: string, selector: string, wordCap: number,\n linkCap: number, controlCap: number, requestedWidth: number,\n ) => {\n const dom: any = (globalThis as any).document;\n const win: any = globalThis as any;\n const compute: any = win.getComputedStyle;\n const withinViewport = (el: any): boolean => {\n if (!el || el.closest(\"[hidden],[inert],[aria-hidden='true']\")) return false;\n const s = compute(el);\n const r = el.getBoundingClientRect();\n return s.display !== \"none\" &&\n s.visibility !== \"hidden\" && s.visibility !== \"collapse\" &&\n Number.parseFloat(s.opacity || \"1\") > 0 &&\n r.width > 0 && r.height > 0;\n };\n const words = (text: string): string[] =>\n (text.normalize(\"NFKC\").toLocaleLowerCase(\"en\")\n .match(/[\\p{L}\\p{N}]+/gu) ?? [])\n .filter((token) => token.length >= 2 && token.length <= 60)\n .slice(0, wordCap);\n const title = String(dom.querySelector(\"head title\")?.textContent ?? \"\")\n .replace(/\\s+/gu, \" \").trim().slice(0, 256);\n const desc = String(dom.querySelector('head meta[name=\"description\" i]')\n ?.getAttribute(\"content\") ?? \"\").trim().slice(0, 256);\n const firstH1 = String(dom.querySelector(\"body h1\")?.textContent ?? \"\")\n .replace(/\\s+/gu, \" \").trim().slice(0, 256);\n const main: any = dom.querySelector(\"main,[role='main'],article\") ?? dom.body;\n // Keep CSS-hidden page content in the DOM comparison, but exclude\n // inert script/style/template text that is not page copy. Clone only\n // the bounded supplied document so JSON-LD counts stay unchanged.\n const textOnlyMain: any = main?.cloneNode(true);\n textOnlyMain?.querySelectorAll(\"script,style,template\")\n .forEach((node: any) => node.remove());\n const rawText = String(textOnlyMain?.textContent ?? \"\");\n const visibleText = String(main?.innerText ?? \"\");\n const rawTokens = words(rawText);\n const visibleTokens = words(visibleText);\n const anchors: any[] = Array.from(dom.querySelectorAll(\"body a[href]\"));\n const origin = new URL(url).origin;\n let base = url;\n let foreignBase = false;\n const baseHref = dom.querySelector(\"head base[href]\")?.getAttribute(\"href\");\n if (baseHref) {\n try {\n const candidate = new URL(baseHref, url);\n if (candidate.origin === origin && !candidate.search &&\n !candidate.username && !candidate.password && !candidate.port) {\n base = candidate.href;\n } else foreignBase = true;\n } catch { foreignBase = true; }\n }\n const links: string[] = [], visibleLinks: string[] = [],\n navLinks: string[] = [];\n for (const anchor of anchors.slice(0, linkCap)) {\n const raw = String(anchor.getAttribute(\"href\") ?? \"\").trim();\n if (!raw || raw.length > 1_024 || raw.startsWith(\"#\") ||\n (foreignBase && !/^[a-z][a-z0-9+.-]*:/iu.test(raw) &&\n !raw.startsWith(\"//\"))) continue;\n try {\n const resolved = new URL(raw, base);\n if (![\"https:\", \"http:\"].includes(resolved.protocol) ||\n resolved.origin !== origin || resolved.username ||\n resolved.password || resolved.port || resolved.search ||\n raw.includes(\"?\")) continue;\n resolved.hash = \"\";\n const label = resolved.href;\n links.push(label);\n if (withinViewport(anchor)) {\n visibleLinks.push(label);\n if (anchor.closest(\"nav,header,footer,[role='navigation']\")) {\n navLinks.push(label);\n }\n }\n } catch { /* Invalid/unsupported link is not evidence. */ }\n }\n const controls: any[] = Array.from(dom.querySelectorAll(selector));\n let visibleControls = 0, focusable = 0, smallTargets = 0;\n for (const el of controls.slice(0, controlCap)) {\n if (!withinViewport(el)) continue;\n visibleControls++;\n if (el.tabIndex >= 0 && !el.disabled) focusable++;\n const box = el.getBoundingClientRect();\n if (box.width < 24 || box.height < 24) smallTargets++;\n }\n const rawCanonicals: string[] = [];\n let canonicalDeclarations = 0;\n for (const link of Array.from(dom.querySelectorAll(\"head link[rel]\")) as any[]) {\n if (!String(link.rel ?? \"\").toLowerCase().split(/\\s+/u).includes(\"canonical\")) continue;\n canonicalDeclarations++;\n try {\n const c = new URL(String(link.getAttribute(\"href\")), url);\n c.hash = \"\";\n if ([\"http:\",\"https:\"].includes(c.protocol) &&\n !c.username && !c.password && !c.port && !c.search &&\n c.href.length <= 512) rawCanonicals.push(c.href);\n } catch { /* No reliable canonical label from this markup. */ }\n }\n const robots = Array.from(dom.querySelectorAll(\"head meta[name][content]\")) as any[];\n const noindex = robots.some((meta) =>\n [\"robots\",\"googlebot\"].includes(String(meta.name ?? \"\").toLowerCase()) &&\n /(?:^|[\\s,;])(?:noindex|none)(?:$|[\\s,;])/iu.test(String(meta.content ?? \"\")));\n const jsonld = Array.from(dom.querySelectorAll(\"script[type]\"))\n .filter((script: any) => String(script.getAttribute(\"type\") ?? \"\")\n .split(\";\", 1)[0].trim().toLowerCase() === \"application/ld+json\")\n .length;\n const effective = Math.round(Number(win.innerWidth) || 0);\n const scrollWidth = Math.round(Number(dom.documentElement?.scrollWidth) || effective);\n return {\n width: 0, height: 0,\n effective_layout_width: effective,\n viewport_meta_present: Boolean(dom.querySelector('head meta[name=\"viewport\" i]')),\n title, description: desc, first_h1: firstH1,\n h1_count: dom.querySelectorAll(\"body h1\").length,\n main_dom_words: rawTokens, main_visible_words: visibleTokens,\n same_origin_links: [...new Set(links)],\n visible_links: [...new Set(visibleLinks)],\n visible_nav_links: [...new Set(navLinks)],\n canonical: canonicalDeclarations === 0 ? null :\n canonicalDeclarations === 1 && rawCanonicals.length === 1\n ? rawCanonicals[0] : \"unverified\",\n noindex, jsonld_blocks: jsonld,\n controls_seen: controls.length, visible_controls: visibleControls,\n keyboard_focusable_controls: focusable,\n small_visible_controls: smallTargets,\n observed_keyboard_targets: 0, keyboard_incomplete: false,\n disclosure_toggled: null,\n // In mobile emulation, innerWidth may itself expand to the widest\n // unbreakable element. Compare against the configured CSS viewport,\n // otherwise a 650px element can incorrectly look like zero overflow.\n horizontal_overflow_px: Math.max(0, Math.max(scrollWidth, effective) - requestedWidth),\n sample_truncated: rawText.length > 65_536 ||\n visibleText.length > 65_536 || controls.length > controlCap ||\n anchors.length > linkCap || words(rawText).length >= wordCap ||\n words(visibleText).length >= wordCap,\n };\n }, pageUrl, CONTROL_SELECTOR, MAX_PARITY_WORDS,\n MAX_PARITY_LINKS, MAX_PARITY_CONTROLS, vp.width);\n // The evidence contract records the requested *CSS screen* dimensions.\n // Browser effective viewport width is recorded separately.\n snapshot.width = vp.width;\n snapshot.height = vp.height;\n\n const seen = new Set<number>();\n if (snapshot.keyboard_focusable_controls > 0) {\n try {\n await page.evaluate(() => { (globalThis as any).document.activeElement?.blur?.(); });\n for (let i = 0; i < MAX_PARITY_TAB_STEPS; i++) {\n await page.keyboard.press(\"Tab\");\n const ordinal = await page.evaluate((selector: string, cap: number) => {\n const dom: any = (globalThis as any).document;\n const index = Array.from(dom.querySelectorAll(selector))\n .indexOf(dom.activeElement) + 1;\n return index <= cap ? index : 0;\n }, CONTROL_SELECTOR, MAX_PARITY_CONTROLS);\n if (!ordinal || seen.has(ordinal)) break;\n seen.add(ordinal);\n }\n snapshot.observed_keyboard_targets = seen.size;\n snapshot.keyboard_incomplete = snapshot.keyboard_focusable_controls > seen.size &&\n (seen.size >= MAX_PARITY_TAB_STEPS ||\n snapshot.controls_seen > MAX_PARITY_CONTROLS);\n } catch { snapshot.keyboard_incomplete = true; }\n }\n\n // Native <details> is the only element that can be activated. No arbitrary\n // click, link navigation or form submission is allowed in this diagnostic.\n const summary = await page.evaluate(() => {\n const dom: any = (globalThis as any).document;\n const el: any = dom.querySelector(\"details > summary\");\n if (!el || el.closest(\"[hidden],[inert]\")) return null;\n const s = (globalThis as any).getComputedStyle(el);\n const box = el.getBoundingClientRect();\n const width = Number((globalThis as any).innerWidth);\n const height = Number((globalThis as any).innerHeight);\n if (s.display === \"none\" || s.visibility !== \"visible\" ||\n box.width < 1 || box.height < 1 || box.right <= 0 || box.bottom <= 0 ||\n box.left >= width || box.top >= height) return null;\n return {\n x: Math.min(width - 2, Math.max(2, box.left + box.width / 2)),\n y: Math.min(height - 2, Math.max(2, box.top + box.height / 2)),\n before: Boolean(el.parentElement?.open),\n };\n });\n if (summary) {\n try {\n if (kind === \"mobile\") {\n await page.touchscreen.tap(summary.x, summary.y);\n } else {\n await page.evaluate(() => {\n (globalThis as any).document.querySelector(\"details > summary\")?.focus();\n });\n await page.keyboard.press(\"Enter\");\n }\n const after = await page.evaluate(() =>\n Boolean((globalThis as any).document\n .querySelector(\"details > summary\")?.parentElement?.open));\n snapshot.disclosure_toggled = summary.before !== after;\n } catch { snapshot.disclosure_toggled = false; }\n }\n samples.push(snapshot);\n await page.close();\n }\n return analyzeViewportParity(pageUrl, samples[0], samples[1], {\n scope, blockedResources: Math.min(1_000, blocked),\n });\n } catch (cause) {\n pendingFailure = cause;\n throw cause;\n } finally {\n if (timer) clearTimeout(timer);\n try { if (browser) await browser.close(); }\n catch (cause) { if (!pendingFailure) throw cause; }\n }\n}\n\n/** One public robots-gated HTML GET, then two isolated offline viewports. */\nexport async function inspectPublicViewportParity(\n url: string, runtime: ScreenshotBrowserRuntime = defaultScreenshotBrowserRuntime,\n): Promise<ViewportParityReview> {\n const { page_url, raw_html } = await fetchGuardedPublicHtml(url);\n return inspectViewportParity(raw_html, page_url, runtime,\n \"isolated_public_html_viewports\");\n}\n"]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export declare const MAX_PARITY_HTML_BYTES = 400000;
|
|
2
|
+
export declare const MAX_PARITY_WORDS = 4000;
|
|
3
|
+
export declare const MAX_PARITY_LINKS = 120;
|
|
4
|
+
export declare const MAX_PARITY_CONTROLS = 120;
|
|
5
|
+
export declare const MAX_PARITY_TAB_STEPS = 12;
|
|
6
|
+
export declare const MAX_PARITY_FINDINGS = 16;
|
|
7
|
+
export declare const MAX_PARITY_BROWSER_MS = 25000;
|
|
8
|
+
export declare const MOBILE_VIEWPORT: {
|
|
9
|
+
readonly width: 375;
|
|
10
|
+
readonly height: 812;
|
|
11
|
+
readonly deviceScaleFactor: 2;
|
|
12
|
+
readonly isMobile: true;
|
|
13
|
+
readonly hasTouch: true;
|
|
14
|
+
};
|
|
15
|
+
export declare const DESKTOP_VIEWPORT: {
|
|
16
|
+
readonly width: 1440;
|
|
17
|
+
readonly height: 900;
|
|
18
|
+
readonly deviceScaleFactor: 1;
|
|
19
|
+
readonly isMobile: false;
|
|
20
|
+
readonly hasTouch: false;
|
|
21
|
+
};
|
|
22
|
+
export declare const PARITY_FINDING_CODES: readonly ["mobile_viewport_meta_missing", "mobile_horizontal_overflow", "mobile_title_missing", "mobile_description_missing", "title_mismatch", "description_mismatch", "mobile_h1_missing", "h1_mismatch", "mobile_main_text_less", "mobile_visible_main_text_less", "mobile_content_visibility_gap", "mobile_navigation_less", "mobile_links_less", "mobile_canonical_mismatch", "mobile_robots_mismatch", "mobile_structured_data_less", "mobile_controls_less", "mobile_keyboard_targets_less", "mobile_small_targets", "native_disclosure_parity", "resource_loads_blocked", "sample_limited"];
|
|
23
|
+
export type ParityFindingCode = typeof PARITY_FINDING_CODES[number];
|
|
24
|
+
export type ParityScope = "isolated_supplied_html_viewports" | "isolated_public_html_viewports";
|
|
25
|
+
export interface ViewportEvidence {
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
effective_layout_width: number;
|
|
29
|
+
viewport_meta_present: boolean;
|
|
30
|
+
title: string;
|
|
31
|
+
description: string;
|
|
32
|
+
first_h1: string;
|
|
33
|
+
h1_count: number;
|
|
34
|
+
main_dom_words: string[];
|
|
35
|
+
main_visible_words: string[];
|
|
36
|
+
same_origin_links: string[];
|
|
37
|
+
visible_links: string[];
|
|
38
|
+
visible_nav_links: string[];
|
|
39
|
+
canonical: string | "unverified" | null;
|
|
40
|
+
noindex: boolean;
|
|
41
|
+
jsonld_blocks: number;
|
|
42
|
+
controls_seen: number;
|
|
43
|
+
visible_controls: number;
|
|
44
|
+
keyboard_focusable_controls: number;
|
|
45
|
+
small_visible_controls: number;
|
|
46
|
+
observed_keyboard_targets: number;
|
|
47
|
+
keyboard_incomplete: boolean;
|
|
48
|
+
disclosure_toggled: boolean | null;
|
|
49
|
+
horizontal_overflow_px: number;
|
|
50
|
+
sample_truncated: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface ViewportSummary {
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
effective_layout_width: number;
|
|
56
|
+
viewport_meta_present: boolean;
|
|
57
|
+
title_present: boolean;
|
|
58
|
+
description_present: boolean;
|
|
59
|
+
h1_count: number;
|
|
60
|
+
main_dom_words: number;
|
|
61
|
+
main_visible_words: number;
|
|
62
|
+
internal_links: number;
|
|
63
|
+
visible_links: number;
|
|
64
|
+
visible_nav_links: number;
|
|
65
|
+
canonical: "missing" | "self" | "different" | "unverified";
|
|
66
|
+
noindex_declared: boolean;
|
|
67
|
+
jsonld_blocks: number;
|
|
68
|
+
controls_seen: number;
|
|
69
|
+
visible_controls: number;
|
|
70
|
+
keyboard_focusable_controls: number;
|
|
71
|
+
small_visible_controls: number;
|
|
72
|
+
observed_keyboard_targets: number;
|
|
73
|
+
keyboard_incomplete: boolean;
|
|
74
|
+
disclosure_toggled: boolean | null;
|
|
75
|
+
horizontal_overflow_px: number;
|
|
76
|
+
sample_truncated: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface ParityFinding {
|
|
79
|
+
code: ParityFindingCode;
|
|
80
|
+
severity: "warning" | "info";
|
|
81
|
+
count: number;
|
|
82
|
+
message: string;
|
|
83
|
+
}
|
|
84
|
+
export interface ViewportParityReview {
|
|
85
|
+
scope: ParityScope;
|
|
86
|
+
browser_executed: boolean;
|
|
87
|
+
scripts_disabled: true;
|
|
88
|
+
mobile: ViewportSummary;
|
|
89
|
+
desktop: ViewportSummary;
|
|
90
|
+
titles_equivalent: boolean;
|
|
91
|
+
descriptions_equivalent: boolean;
|
|
92
|
+
h1_equivalent: boolean;
|
|
93
|
+
canonicals_equivalent: boolean;
|
|
94
|
+
robots_equivalent: boolean;
|
|
95
|
+
structured_data_count_equivalent: boolean;
|
|
96
|
+
mobile_missing_dom_tokens: number;
|
|
97
|
+
mobile_missing_visible_tokens: number;
|
|
98
|
+
mobile_missing_internal_links: number;
|
|
99
|
+
mobile_missing_visible_links: number;
|
|
100
|
+
blocked_resources: number;
|
|
101
|
+
coverage_limited: true;
|
|
102
|
+
limitations: string[];
|
|
103
|
+
total_findings: number;
|
|
104
|
+
findings: ParityFinding[];
|
|
105
|
+
findings_truncated: boolean;
|
|
106
|
+
error?: string;
|
|
107
|
+
}
|
|
108
|
+
export declare function emptyViewportParityReview(scope?: ParityScope): ViewportParityReview;
|
|
109
|
+
export declare function analyzeViewportParity(pageUrl: string, mobile: ViewportEvidence, desktop: ViewportEvidence, opts?: {
|
|
110
|
+
scope?: ParityScope;
|
|
111
|
+
blockedResources?: number;
|
|
112
|
+
}): ViewportParityReview;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V09 local-only: compare bounded observed mobile/desktop Chromium viewports.
|
|
3
|
+
* Browser collection is separate from this deterministic redacted analyzer.
|
|
4
|
+
* Google WRS, dynamic JS hydration and actual indexing are NOT inferred.
|
|
5
|
+
*/
|
|
6
|
+
import { safeLinkPageUrl } from "../site-architecture/internal-link-quality.js";
|
|
7
|
+
export const MAX_PARITY_HTML_BYTES = 400_000;
|
|
8
|
+
export const MAX_PARITY_WORDS = 4_000;
|
|
9
|
+
export const MAX_PARITY_LINKS = 120;
|
|
10
|
+
export const MAX_PARITY_CONTROLS = 120;
|
|
11
|
+
export const MAX_PARITY_TAB_STEPS = 12;
|
|
12
|
+
export const MAX_PARITY_FINDINGS = 16;
|
|
13
|
+
export const MAX_PARITY_BROWSER_MS = 25_000;
|
|
14
|
+
export const MOBILE_VIEWPORT = { width: 375, height: 812, deviceScaleFactor: 2, isMobile: true, hasTouch: true };
|
|
15
|
+
export const DESKTOP_VIEWPORT = { width: 1440, height: 900, deviceScaleFactor: 1, isMobile: false, hasTouch: false };
|
|
16
|
+
export const PARITY_FINDING_CODES = [
|
|
17
|
+
"mobile_viewport_meta_missing", "mobile_horizontal_overflow",
|
|
18
|
+
"mobile_title_missing", "mobile_description_missing",
|
|
19
|
+
"title_mismatch", "description_mismatch", "mobile_h1_missing", "h1_mismatch",
|
|
20
|
+
"mobile_main_text_less", "mobile_visible_main_text_less",
|
|
21
|
+
"mobile_content_visibility_gap", "mobile_navigation_less",
|
|
22
|
+
"mobile_links_less", "mobile_canonical_mismatch", "mobile_robots_mismatch",
|
|
23
|
+
"mobile_structured_data_less", "mobile_controls_less",
|
|
24
|
+
"mobile_keyboard_targets_less", "mobile_small_targets",
|
|
25
|
+
"native_disclosure_parity", "resource_loads_blocked", "sample_limited",
|
|
26
|
+
];
|
|
27
|
+
const limitations = [
|
|
28
|
+
"Two fixed Chromium viewport samples of one supplied/public HTML document are compared; this is not a Googlebot smartphone render, mobile-first indexing verdict, or full-site audit.",
|
|
29
|
+
"All page JavaScript and external CSS, fonts, images and API resources are disabled in the isolated browser; media queries in inline styles are evaluated, but hydrated layouts are not.",
|
|
30
|
+
"A mobile-hidden menu can be intentional responsive navigation; links and text hidden only with CSS may still exist in the DOM. Differences are review leads, not proven SEO or WCAG failures.",
|
|
31
|
+
"Keyboard samples and one safe native disclosure toggle are limited; no arbitrary buttons/links are activated, no forms submitted, no screenshots stored, and no page text or URLs returned.",
|
|
32
|
+
];
|
|
33
|
+
const nonnegative = (n) => Number.isSafeInteger(n) && n >= 0 && n <= 100_000;
|
|
34
|
+
const bytes = (s) => new TextEncoder().encode(s).byteLength;
|
|
35
|
+
const normalized = (s) => s.normalize("NFKC").toLocaleLowerCase("en").replace(/\s+/gu, " ").trim();
|
|
36
|
+
function checkEvidence(x, target) {
|
|
37
|
+
const vp = target === "mobile" ? MOBILE_VIEWPORT : DESKTOP_VIEWPORT;
|
|
38
|
+
if (!x || typeof x !== "object" || x.width !== vp.width || x.height !== vp.height ||
|
|
39
|
+
!nonnegative(x.effective_layout_width) || x.effective_layout_width > 5_000 ||
|
|
40
|
+
typeof x.viewport_meta_present !== "boolean" ||
|
|
41
|
+
typeof x.noindex !== "boolean" || typeof x.keyboard_incomplete !== "boolean" ||
|
|
42
|
+
typeof x.sample_truncated !== "boolean" ||
|
|
43
|
+
(x.disclosure_toggled !== null && typeof x.disclosure_toggled !== "boolean") ||
|
|
44
|
+
!["title", "description", "first_h1"].every((k) => typeof x[k] === "string" &&
|
|
45
|
+
bytes(x[k]) <= 1_024) ||
|
|
46
|
+
![x.h1_count, x.jsonld_blocks, x.controls_seen, x.visible_controls,
|
|
47
|
+
x.keyboard_focusable_controls, x.small_visible_controls,
|
|
48
|
+
x.observed_keyboard_targets, x.horizontal_overflow_px].every(nonnegative) ||
|
|
49
|
+
x.visible_controls > x.controls_seen ||
|
|
50
|
+
x.keyboard_focusable_controls > x.controls_seen ||
|
|
51
|
+
x.small_visible_controls > x.visible_controls ||
|
|
52
|
+
x.observed_keyboard_targets > MAX_PARITY_TAB_STEPS ||
|
|
53
|
+
!Array.isArray(x.main_dom_words) || x.main_dom_words.length > MAX_PARITY_WORDS ||
|
|
54
|
+
!Array.isArray(x.main_visible_words) || x.main_visible_words.length > MAX_PARITY_WORDS ||
|
|
55
|
+
![x.main_dom_words, x.main_visible_words].every((arr) => arr.every((w) => typeof w === "string" && w.length > 0 && w.length <= 60 &&
|
|
56
|
+
!/[\u0000-\u001f\u007f]/u.test(w))) ||
|
|
57
|
+
![x.same_origin_links, x.visible_links, x.visible_nav_links].every((arr) => Array.isArray(arr) && arr.length <= MAX_PARITY_LINKS &&
|
|
58
|
+
arr.every((url) => typeof url === "string" && bytes(url) <= 512 &&
|
|
59
|
+
Boolean(safeLinkPageUrl(url)))) ||
|
|
60
|
+
(x.canonical !== null && x.canonical !== "unverified" &&
|
|
61
|
+
(typeof x.canonical !== "string" ||
|
|
62
|
+
bytes(x.canonical) > 512 || !safeLinkPageUrl(x.canonical)))) {
|
|
63
|
+
throw new Error("Invalid bounded " + target + " browser evidence.");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function tokensWithout(a, b) {
|
|
67
|
+
const compared = new Set(b);
|
|
68
|
+
return new Set(a.filter((word) => !compared.has(word))).size;
|
|
69
|
+
}
|
|
70
|
+
function uniqueWithout(a, b) {
|
|
71
|
+
const compared = new Set(b);
|
|
72
|
+
return new Set(a.filter((url) => !compared.has(url))).size;
|
|
73
|
+
}
|
|
74
|
+
const summary = (e, pageUrl) => ({
|
|
75
|
+
width: e.width, height: e.height,
|
|
76
|
+
effective_layout_width: e.effective_layout_width,
|
|
77
|
+
viewport_meta_present: e.viewport_meta_present,
|
|
78
|
+
title_present: Boolean(e.title.trim()),
|
|
79
|
+
description_present: Boolean(e.description.trim()),
|
|
80
|
+
h1_count: e.h1_count, main_dom_words: e.main_dom_words.length,
|
|
81
|
+
main_visible_words: e.main_visible_words.length,
|
|
82
|
+
internal_links: new Set(e.same_origin_links).size,
|
|
83
|
+
visible_links: new Set(e.visible_links).size,
|
|
84
|
+
visible_nav_links: new Set(e.visible_nav_links).size,
|
|
85
|
+
canonical: e.canonical === "unverified" ? "unverified" :
|
|
86
|
+
!e.canonical ? "missing" :
|
|
87
|
+
e.canonical === pageUrl ? "self" :
|
|
88
|
+
safeLinkPageUrl(e.canonical) ? "different" : "unverified",
|
|
89
|
+
noindex_declared: e.noindex, jsonld_blocks: e.jsonld_blocks,
|
|
90
|
+
controls_seen: e.controls_seen,
|
|
91
|
+
visible_controls: e.visible_controls,
|
|
92
|
+
keyboard_focusable_controls: e.keyboard_focusable_controls,
|
|
93
|
+
small_visible_controls: e.small_visible_controls,
|
|
94
|
+
observed_keyboard_targets: e.observed_keyboard_targets,
|
|
95
|
+
keyboard_incomplete: e.keyboard_incomplete,
|
|
96
|
+
disclosure_toggled: e.disclosure_toggled,
|
|
97
|
+
horizontal_overflow_px: e.horizontal_overflow_px,
|
|
98
|
+
sample_truncated: e.sample_truncated,
|
|
99
|
+
});
|
|
100
|
+
function emptySummary(width, height) {
|
|
101
|
+
return {
|
|
102
|
+
width, height, effective_layout_width: width,
|
|
103
|
+
viewport_meta_present: false, title_present: false,
|
|
104
|
+
description_present: false, h1_count: 0, main_dom_words: 0,
|
|
105
|
+
main_visible_words: 0, internal_links: 0, visible_links: 0,
|
|
106
|
+
visible_nav_links: 0, canonical: "unverified", noindex_declared: false,
|
|
107
|
+
jsonld_blocks: 0, controls_seen: 0, visible_controls: 0,
|
|
108
|
+
keyboard_focusable_controls: 0, small_visible_controls: 0,
|
|
109
|
+
observed_keyboard_targets: 0, keyboard_incomplete: true,
|
|
110
|
+
disclosure_toggled: null, horizontal_overflow_px: 0,
|
|
111
|
+
sample_truncated: false,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export function emptyViewportParityReview(scope = "isolated_supplied_html_viewports") {
|
|
115
|
+
return {
|
|
116
|
+
scope, browser_executed: false, scripts_disabled: true,
|
|
117
|
+
mobile: emptySummary(MOBILE_VIEWPORT.width, MOBILE_VIEWPORT.height),
|
|
118
|
+
desktop: emptySummary(DESKTOP_VIEWPORT.width, DESKTOP_VIEWPORT.height),
|
|
119
|
+
titles_equivalent: false, descriptions_equivalent: false,
|
|
120
|
+
h1_equivalent: false, canonicals_equivalent: false,
|
|
121
|
+
robots_equivalent: false, structured_data_count_equivalent: false,
|
|
122
|
+
mobile_missing_dom_tokens: 0, mobile_missing_visible_tokens: 0,
|
|
123
|
+
mobile_missing_internal_links: 0, mobile_missing_visible_links: 0,
|
|
124
|
+
blocked_resources: 0, coverage_limited: true, limitations,
|
|
125
|
+
total_findings: 0, findings: [], findings_truncated: false,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
export function analyzeViewportParity(pageUrl, mobile, desktop, opts = {}) {
|
|
129
|
+
const url = safeLinkPageUrl(pageUrl);
|
|
130
|
+
if (!url)
|
|
131
|
+
throw new Error("Use one safe same-origin query-free HTTP(S) page URL.");
|
|
132
|
+
checkEvidence(mobile, "mobile");
|
|
133
|
+
checkEvidence(desktop, "desktop");
|
|
134
|
+
const origin = new URL(url).origin;
|
|
135
|
+
for (const sample of [mobile, desktop]) {
|
|
136
|
+
for (const label of [
|
|
137
|
+
...sample.same_origin_links, ...sample.visible_links, ...sample.visible_nav_links,
|
|
138
|
+
]) {
|
|
139
|
+
if (new URL(label).origin !== origin) {
|
|
140
|
+
throw new Error("Viewport link evidence must stay within the declared page origin.");
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
const report = emptyViewportParityReview(opts.scope);
|
|
145
|
+
report.browser_executed = true;
|
|
146
|
+
if (opts.blockedResources !== undefined &&
|
|
147
|
+
(!nonnegative(opts.blockedResources) || opts.blockedResources > 1_000)) {
|
|
148
|
+
throw new Error("Invalid bounded blocked-resource count.");
|
|
149
|
+
}
|
|
150
|
+
report.blocked_resources = opts.blockedResources ?? 0;
|
|
151
|
+
report.mobile = summary(mobile, url);
|
|
152
|
+
report.desktop = summary(desktop, url);
|
|
153
|
+
report.titles_equivalent = normalized(mobile.title) === normalized(desktop.title);
|
|
154
|
+
report.descriptions_equivalent = normalized(mobile.description) === normalized(desktop.description);
|
|
155
|
+
report.h1_equivalent = mobile.h1_count === desktop.h1_count &&
|
|
156
|
+
normalized(mobile.first_h1) === normalized(desktop.first_h1);
|
|
157
|
+
report.canonicals_equivalent = mobile.canonical === desktop.canonical;
|
|
158
|
+
report.robots_equivalent = mobile.noindex === desktop.noindex;
|
|
159
|
+
report.structured_data_count_equivalent = mobile.jsonld_blocks === desktop.jsonld_blocks;
|
|
160
|
+
report.mobile_missing_dom_tokens = tokensWithout(desktop.main_dom_words, mobile.main_dom_words);
|
|
161
|
+
report.mobile_missing_visible_tokens = tokensWithout(desktop.main_visible_words, mobile.main_visible_words);
|
|
162
|
+
report.mobile_missing_internal_links = uniqueWithout(desktop.same_origin_links, mobile.same_origin_links);
|
|
163
|
+
report.mobile_missing_visible_links = uniqueWithout(desktop.visible_links, mobile.visible_links);
|
|
164
|
+
const all = [];
|
|
165
|
+
const add = (code, severity, count, message) => {
|
|
166
|
+
if (count > 0)
|
|
167
|
+
all.push({ code, severity, count, message });
|
|
168
|
+
};
|
|
169
|
+
if (!mobile.viewport_meta_present)
|
|
170
|
+
add("mobile_viewport_meta_missing", "info", 1, "No responsive viewport meta declaration was observed; the mobile layout viewport may be wider than the device.");
|
|
171
|
+
if (mobile.horizontal_overflow_px > 20)
|
|
172
|
+
add("mobile_horizontal_overflow", "warning", mobile.horizontal_overflow_px, "Mobile layout extends horizontally beyond its effective viewport; inspect responsive overflow.");
|
|
173
|
+
if (desktop.title.trim() && !mobile.title.trim())
|
|
174
|
+
add("mobile_title_missing", "warning", 1, "Mobile viewport lacks the page title present on desktop.");
|
|
175
|
+
else if (!report.titles_equivalent)
|
|
176
|
+
add("title_mismatch", "warning", 1, "Mobile and desktop title declarations differ.");
|
|
177
|
+
if (desktop.description.trim() && !mobile.description.trim())
|
|
178
|
+
add("mobile_description_missing", "warning", 1, "Mobile viewport lacks the meta description observed on desktop.");
|
|
179
|
+
else if (!report.descriptions_equivalent)
|
|
180
|
+
add("description_mismatch", "info", 1, "Mobile and desktop meta description declarations differ.");
|
|
181
|
+
if (desktop.h1_count > 0 && mobile.h1_count === 0)
|
|
182
|
+
add("mobile_h1_missing", "warning", 1, "Mobile DOM lacks an H1 present on desktop.");
|
|
183
|
+
else if (!report.h1_equivalent)
|
|
184
|
+
add("h1_mismatch", "info", 1, "Mobile and desktop H1 structure or first heading differs.");
|
|
185
|
+
if ((report.mobile_missing_dom_tokens >= 12 && desktop.main_dom_words.length >= 20) ||
|
|
186
|
+
(report.mobile_missing_dom_tokens >= 4 && desktop.main_dom_words.length >= 8 &&
|
|
187
|
+
mobile.main_dom_words.length * 2 <= desktop.main_dom_words.length))
|
|
188
|
+
add("mobile_main_text_less", "warning", report.mobile_missing_dom_tokens, "Some distinct main-content words present on desktop are absent from the mobile DOM sample.");
|
|
189
|
+
if (report.mobile_missing_visible_tokens >= 12 && desktop.main_visible_words.length >= 20)
|
|
190
|
+
add("mobile_visible_main_text_less", "info", report.mobile_missing_visible_tokens, "Some main-content words visibly present on desktop were not visibly rendered at the mobile viewport.");
|
|
191
|
+
if (mobile.main_dom_words.length >= 20 &&
|
|
192
|
+
mobile.main_visible_words.length < Math.floor(mobile.main_dom_words.length * 0.5))
|
|
193
|
+
add("mobile_content_visibility_gap", "info", mobile.main_dom_words.length - mobile.main_visible_words.length, "Most sampled mobile DOM words are not visually exposed at this viewport; CSS hiding or disclosures may be intentional.");
|
|
194
|
+
if (desktop.visible_nav_links.length > mobile.visible_nav_links.length)
|
|
195
|
+
add("mobile_navigation_less", "info", desktop.visible_nav_links.length - mobile.visible_nav_links.length, "Fewer navigation links are visible on mobile; check whether a collapsed menu exposes them without relying on scripting.");
|
|
196
|
+
if (report.mobile_missing_internal_links)
|
|
197
|
+
add("mobile_links_less", "warning", report.mobile_missing_internal_links, "Some same-origin link targets exist on desktop but not in the mobile DOM snapshot.");
|
|
198
|
+
if (!report.canonicals_equivalent)
|
|
199
|
+
add("mobile_canonical_mismatch", "warning", 1, "Mobile and desktop canonical preferences differ; check the effective HTML declarations.");
|
|
200
|
+
if (!report.robots_equivalent)
|
|
201
|
+
add("mobile_robots_mismatch", "warning", 1, "Mobile and desktop robots noindex signals differ; check intended indexing behavior.");
|
|
202
|
+
if (mobile.jsonld_blocks < desktop.jsonld_blocks)
|
|
203
|
+
add("mobile_structured_data_less", "info", desktop.jsonld_blocks - mobile.jsonld_blocks, "Fewer JSON-LD blocks are present in the mobile DOM; validate each version's structured data separately.");
|
|
204
|
+
if (mobile.visible_controls < desktop.visible_controls)
|
|
205
|
+
add("mobile_controls_less", "info", desktop.visible_controls - mobile.visible_controls, "Fewer interactive controls are visible on mobile; responsive UI differences may be intentional.");
|
|
206
|
+
if (mobile.observed_keyboard_targets < desktop.observed_keyboard_targets)
|
|
207
|
+
add("mobile_keyboard_targets_less", "info", desktop.observed_keyboard_targets - mobile.observed_keyboard_targets, "A smaller number of Tab targets was observed on mobile in this short isolated keyboard sample.");
|
|
208
|
+
if (mobile.small_visible_controls)
|
|
209
|
+
add("mobile_small_targets", "info", mobile.small_visible_controls, "Some mobile controls are under 24 CSS pixels in width or height; spacing exemptions and WCAG conformance were not assessed.");
|
|
210
|
+
if (mobile.disclosure_toggled === false || desktop.disclosure_toggled === false)
|
|
211
|
+
add("native_disclosure_parity", "warning", 1, "An inspected native details disclosure did not toggle in one viewport; verify behavior independently.");
|
|
212
|
+
if (report.blocked_resources)
|
|
213
|
+
add("resource_loads_blocked", "info", report.blocked_resources, "External resource requests were blocked by this diagnostic, so framework hydration and external styles are unknown.");
|
|
214
|
+
if (mobile.sample_truncated || desktop.sample_truncated ||
|
|
215
|
+
mobile.keyboard_incomplete || desktop.keyboard_incomplete)
|
|
216
|
+
add("sample_limited", "info", 1, "A DOM, control or keyboard sample reached a fixed evidence limit or remained incomplete.");
|
|
217
|
+
all.sort((a, b) => (a.severity === b.severity ? 0 : a.severity === "warning" ? -1 : 1)
|
|
218
|
+
|| a.code.localeCompare(b.code));
|
|
219
|
+
report.total_findings = all.length;
|
|
220
|
+
report.findings = all.slice(0, MAX_PARITY_FINDINGS);
|
|
221
|
+
report.findings_truncated = all.length > MAX_PARITY_FINDINGS;
|
|
222
|
+
return report;
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=viewport-parity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-parity.js","sourceRoot":"","sources":["../../../src/modules/browser-ux/viewport-parity.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAEhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAO,CAAC;AAC7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AACtC,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAC5C,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,iBAAiB,EAAE,CAAC,EAAE,QAAQ,EAAE,IAA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AM,EAAE,CAAC,EAC7B,0FAA0F,CAAC,CAAC;IAChG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;WACjF,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACnC,MAAM,CAAC,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC;IACnC,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;IACpD,MAAM,CAAC,kBAAkB,GAAG,GAAG,CAAC,MAAM,GAAG,mBAAmB,CAAC;IAC7D,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * V09 local-only: compare bounded observed mobile/desktop Chromium viewports.\n * Browser collection is separate from this deterministic redacted analyzer.\n * Google WRS, dynamic JS hydration and actual indexing are NOT inferred.\n */\nimport { safeLinkPageUrl } from \"../site-architecture/internal-link-quality.js\";\n\nexport const MAX_PARITY_HTML_BYTES = 400_000;\nexport const MAX_PARITY_WORDS = 4_000;\nexport const MAX_PARITY_LINKS = 120;\nexport const MAX_PARITY_CONTROLS = 120;\nexport const MAX_PARITY_TAB_STEPS = 12;\nexport const MAX_PARITY_FINDINGS = 16;\nexport const MAX_PARITY_BROWSER_MS = 25_000;\nexport const MOBILE_VIEWPORT = { width: 375, height: 812, deviceScaleFactor: 2, isMobile: true, hasTouch: true } as const;\nexport const DESKTOP_VIEWPORT = { width: 1440, height: 900, deviceScaleFactor: 1, isMobile: false, hasTouch: false } as const;\n\nexport const PARITY_FINDING_CODES = [\n \"mobile_viewport_meta_missing\", \"mobile_horizontal_overflow\",\n \"mobile_title_missing\", \"mobile_description_missing\",\n \"title_mismatch\", \"description_mismatch\", \"mobile_h1_missing\", \"h1_mismatch\",\n \"mobile_main_text_less\", \"mobile_visible_main_text_less\",\n \"mobile_content_visibility_gap\", \"mobile_navigation_less\",\n \"mobile_links_less\", \"mobile_canonical_mismatch\", \"mobile_robots_mismatch\",\n \"mobile_structured_data_less\", \"mobile_controls_less\",\n \"mobile_keyboard_targets_less\", \"mobile_small_targets\",\n \"native_disclosure_parity\", \"resource_loads_blocked\", \"sample_limited\",\n] as const;\nexport type ParityFindingCode = typeof PARITY_FINDING_CODES[number];\nexport type ParityScope = \"isolated_supplied_html_viewports\" | \"isolated_public_html_viewports\";\n\nexport interface ViewportEvidence {\n width: number;\n height: number;\n effective_layout_width: number;\n viewport_meta_present: boolean;\n title: string;\n description: string;\n first_h1: string;\n h1_count: number;\n main_dom_words: string[];\n main_visible_words: string[];\n same_origin_links: string[];\n visible_links: string[];\n visible_nav_links: string[];\n canonical: string | \"unverified\" | null;\n noindex: boolean;\n jsonld_blocks: number;\n controls_seen: number;\n visible_controls: number;\n keyboard_focusable_controls: number;\n small_visible_controls: number;\n observed_keyboard_targets: number;\n keyboard_incomplete: boolean;\n disclosure_toggled: boolean | null;\n horizontal_overflow_px: number;\n sample_truncated: boolean;\n}\n\nexport interface ViewportSummary {\n width: number;\n height: number;\n effective_layout_width: number;\n viewport_meta_present: boolean;\n title_present: boolean;\n description_present: boolean;\n h1_count: number;\n main_dom_words: number;\n main_visible_words: number;\n internal_links: number;\n visible_links: number;\n visible_nav_links: number;\n canonical: \"missing\" | \"self\" | \"different\" | \"unverified\";\n noindex_declared: boolean;\n jsonld_blocks: number;\n controls_seen: number;\n visible_controls: number;\n keyboard_focusable_controls: number;\n small_visible_controls: number;\n observed_keyboard_targets: number;\n keyboard_incomplete: boolean;\n disclosure_toggled: boolean | null;\n horizontal_overflow_px: number;\n sample_truncated: boolean;\n}\nexport interface ParityFinding {\n code: ParityFindingCode;\n severity: \"warning\" | \"info\";\n count: number;\n message: string;\n}\nexport interface ViewportParityReview {\n scope: ParityScope;\n browser_executed: boolean;\n scripts_disabled: true;\n mobile: ViewportSummary;\n desktop: ViewportSummary;\n titles_equivalent: boolean;\n descriptions_equivalent: boolean;\n h1_equivalent: boolean;\n canonicals_equivalent: boolean;\n robots_equivalent: boolean;\n structured_data_count_equivalent: boolean;\n mobile_missing_dom_tokens: number;\n mobile_missing_visible_tokens: number;\n mobile_missing_internal_links: number;\n mobile_missing_visible_links: number;\n blocked_resources: number;\n coverage_limited: true;\n limitations: string[];\n total_findings: number;\n findings: ParityFinding[];\n findings_truncated: boolean;\n error?: string;\n}\n\nconst limitations = [\n \"Two fixed Chromium viewport samples of one supplied/public HTML document are compared; this is not a Googlebot smartphone render, mobile-first indexing verdict, or full-site audit.\",\n \"All page JavaScript and external CSS, fonts, images and API resources are disabled in the isolated browser; media queries in inline styles are evaluated, but hydrated layouts are not.\",\n \"A mobile-hidden menu can be intentional responsive navigation; links and text hidden only with CSS may still exist in the DOM. Differences are review leads, not proven SEO or WCAG failures.\",\n \"Keyboard samples and one safe native disclosure toggle are limited; no arbitrary buttons/links are activated, no forms submitted, no screenshots stored, and no page text or URLs returned.\",\n];\nconst nonnegative = (n: number) => Number.isSafeInteger(n) && n >= 0 && n <= 100_000;\nconst bytes = (s: string) => new TextEncoder().encode(s).byteLength;\nconst normalized = (s: string) => s.normalize(\"NFKC\").toLocaleLowerCase(\"en\").replace(/\\s+/gu,\" \").trim();\nfunction checkEvidence(x: ViewportEvidence, target: \"mobile\" | \"desktop\"): void {\n const vp = target === \"mobile\" ? MOBILE_VIEWPORT : DESKTOP_VIEWPORT;\n if (!x || typeof x !== \"object\" || x.width !== vp.width || x.height !== vp.height ||\n !nonnegative(x.effective_layout_width) || x.effective_layout_width > 5_000 ||\n typeof x.viewport_meta_present !== \"boolean\" ||\n typeof x.noindex !== \"boolean\" || typeof x.keyboard_incomplete !== \"boolean\" ||\n typeof x.sample_truncated !== \"boolean\" ||\n (x.disclosure_toggled !== null && typeof x.disclosure_toggled !== \"boolean\") ||\n ![\"title\",\"description\",\"first_h1\"].every((k) =>\n typeof x[k as keyof ViewportEvidence] === \"string\" &&\n bytes(x[k as \"title\" | \"description\" | \"first_h1\"] as string) <= 1_024) ||\n ![x.h1_count, x.jsonld_blocks, x.controls_seen, x.visible_controls,\n x.keyboard_focusable_controls, x.small_visible_controls,\n x.observed_keyboard_targets, x.horizontal_overflow_px].every(nonnegative) ||\n x.visible_controls > x.controls_seen ||\n x.keyboard_focusable_controls > x.controls_seen ||\n x.small_visible_controls > x.visible_controls ||\n x.observed_keyboard_targets > MAX_PARITY_TAB_STEPS ||\n !Array.isArray(x.main_dom_words) || x.main_dom_words.length > MAX_PARITY_WORDS ||\n !Array.isArray(x.main_visible_words) || x.main_visible_words.length > MAX_PARITY_WORDS ||\n ![x.main_dom_words, x.main_visible_words].every((arr) => arr.every((w) =>\n typeof w === \"string\" && w.length > 0 && w.length <= 60 &&\n !/[\\u0000-\\u001f\\u007f]/u.test(w))) ||\n ![x.same_origin_links, x.visible_links, x.visible_nav_links].every((arr) =>\n Array.isArray(arr) && arr.length <= MAX_PARITY_LINKS &&\n arr.every((url) => typeof url === \"string\" && bytes(url) <= 512 &&\n Boolean(safeLinkPageUrl(url)))) ||\n (x.canonical !== null && x.canonical !== \"unverified\" &&\n (typeof x.canonical !== \"string\" ||\n bytes(x.canonical) > 512 || !safeLinkPageUrl(x.canonical)))) {\n throw new Error(\"Invalid bounded \" + target + \" browser evidence.\");\n }\n}\nfunction tokensWithout(a: string[], b: string[]) {\n const compared = new Set(b);\n return new Set(a.filter((word) => !compared.has(word))).size;\n}\nfunction uniqueWithout(a: string[], b: string[]) {\n const compared = new Set(b);\n return new Set(a.filter((url) => !compared.has(url))).size;\n}\nconst summary = (e: ViewportEvidence, pageUrl: string): ViewportSummary => ({\n width: e.width, height: e.height,\n effective_layout_width: e.effective_layout_width,\n viewport_meta_present: e.viewport_meta_present,\n title_present: Boolean(e.title.trim()),\n description_present: Boolean(e.description.trim()),\n h1_count: e.h1_count, main_dom_words: e.main_dom_words.length,\n main_visible_words: e.main_visible_words.length,\n internal_links: new Set(e.same_origin_links).size,\n visible_links: new Set(e.visible_links).size,\n visible_nav_links: new Set(e.visible_nav_links).size,\n canonical: e.canonical === \"unverified\" ? \"unverified\" :\n !e.canonical ? \"missing\" :\n e.canonical === pageUrl ? \"self\" :\n safeLinkPageUrl(e.canonical) ? \"different\" : \"unverified\",\n noindex_declared: e.noindex, jsonld_blocks: e.jsonld_blocks,\n controls_seen: e.controls_seen,\n visible_controls: e.visible_controls,\n keyboard_focusable_controls: e.keyboard_focusable_controls,\n small_visible_controls: e.small_visible_controls,\n observed_keyboard_targets: e.observed_keyboard_targets,\n keyboard_incomplete: e.keyboard_incomplete,\n disclosure_toggled: e.disclosure_toggled,\n horizontal_overflow_px: e.horizontal_overflow_px,\n sample_truncated: e.sample_truncated,\n});\nfunction emptySummary(width: number, height: number): ViewportSummary {\n return {\n width, height, effective_layout_width: width,\n viewport_meta_present: false, title_present: false,\n description_present: false, h1_count: 0, main_dom_words: 0,\n main_visible_words: 0, internal_links: 0, visible_links: 0,\n visible_nav_links: 0, canonical: \"unverified\", noindex_declared: false,\n jsonld_blocks: 0, controls_seen: 0, visible_controls: 0,\n keyboard_focusable_controls: 0, small_visible_controls: 0,\n observed_keyboard_targets: 0, keyboard_incomplete: true,\n disclosure_toggled: null, horizontal_overflow_px: 0,\n sample_truncated: false,\n };\n}\nexport function emptyViewportParityReview(\n scope: ParityScope = \"isolated_supplied_html_viewports\",\n): ViewportParityReview {\n return {\n scope, browser_executed: false, scripts_disabled: true,\n mobile: emptySummary(MOBILE_VIEWPORT.width, MOBILE_VIEWPORT.height),\n desktop: emptySummary(DESKTOP_VIEWPORT.width, DESKTOP_VIEWPORT.height),\n titles_equivalent: false, descriptions_equivalent: false,\n h1_equivalent: false, canonicals_equivalent: false,\n robots_equivalent: false, structured_data_count_equivalent: false,\n mobile_missing_dom_tokens: 0, mobile_missing_visible_tokens: 0,\n mobile_missing_internal_links: 0, mobile_missing_visible_links: 0,\n blocked_resources: 0, coverage_limited: true, limitations,\n total_findings: 0, findings: [], findings_truncated: false,\n };\n}\nexport function analyzeViewportParity(\n pageUrl: string, mobile: ViewportEvidence, desktop: ViewportEvidence,\n opts: { scope?: ParityScope; blockedResources?: number } = {},\n): ViewportParityReview {\n const url = safeLinkPageUrl(pageUrl);\n if (!url) throw new Error(\"Use one safe same-origin query-free HTTP(S) page URL.\");\n checkEvidence(mobile, \"mobile\");\n checkEvidence(desktop, \"desktop\");\n const origin = new URL(url).origin;\n for (const sample of [mobile, desktop]) {\n for (const label of [\n ...sample.same_origin_links, ...sample.visible_links, ...sample.visible_nav_links,\n ]) {\n if (new URL(label).origin !== origin) {\n throw new Error(\"Viewport link evidence must stay within the declared page origin.\");\n }\n }\n }\n const report = emptyViewportParityReview(opts.scope);\n report.browser_executed = true;\n if (opts.blockedResources !== undefined &&\n (!nonnegative(opts.blockedResources) || opts.blockedResources > 1_000)) {\n throw new Error(\"Invalid bounded blocked-resource count.\");\n }\n report.blocked_resources = opts.blockedResources ?? 0;\n report.mobile = summary(mobile, url);\n report.desktop = summary(desktop, url);\n report.titles_equivalent = normalized(mobile.title) === normalized(desktop.title);\n report.descriptions_equivalent = normalized(mobile.description) === normalized(desktop.description);\n report.h1_equivalent = mobile.h1_count === desktop.h1_count &&\n normalized(mobile.first_h1) === normalized(desktop.first_h1);\n report.canonicals_equivalent = mobile.canonical === desktop.canonical;\n report.robots_equivalent = mobile.noindex === desktop.noindex;\n report.structured_data_count_equivalent = mobile.jsonld_blocks === desktop.jsonld_blocks;\n report.mobile_missing_dom_tokens = tokensWithout(desktop.main_dom_words, mobile.main_dom_words);\n report.mobile_missing_visible_tokens = tokensWithout(desktop.main_visible_words, mobile.main_visible_words);\n report.mobile_missing_internal_links = uniqueWithout(desktop.same_origin_links, mobile.same_origin_links);\n report.mobile_missing_visible_links = uniqueWithout(desktop.visible_links, mobile.visible_links);\n\n const all: ParityFinding[] = [];\n const add = (code: ParityFindingCode, severity: \"warning\" | \"info\", count: number, message: string) => {\n if (count > 0) all.push({ code, severity, count, message });\n };\n if (!mobile.viewport_meta_present) add(\"mobile_viewport_meta_missing\", \"info\", 1,\n \"No responsive viewport meta declaration was observed; the mobile layout viewport may be wider than the device.\");\n if (mobile.horizontal_overflow_px > 20) add(\"mobile_horizontal_overflow\", \"warning\",\n mobile.horizontal_overflow_px, \"Mobile layout extends horizontally beyond its effective viewport; inspect responsive overflow.\");\n if (desktop.title.trim() && !mobile.title.trim()) add(\"mobile_title_missing\", \"warning\", 1,\n \"Mobile viewport lacks the page title present on desktop.\");\n else if (!report.titles_equivalent) add(\"title_mismatch\", \"warning\", 1,\n \"Mobile and desktop title declarations differ.\");\n if (desktop.description.trim() && !mobile.description.trim()) add(\"mobile_description_missing\", \"warning\", 1,\n \"Mobile viewport lacks the meta description observed on desktop.\");\n else if (!report.descriptions_equivalent) add(\"description_mismatch\", \"info\", 1,\n \"Mobile and desktop meta description declarations differ.\");\n if (desktop.h1_count > 0 && mobile.h1_count === 0) add(\"mobile_h1_missing\", \"warning\", 1,\n \"Mobile DOM lacks an H1 present on desktop.\");\n else if (!report.h1_equivalent) add(\"h1_mismatch\", \"info\", 1,\n \"Mobile and desktop H1 structure or first heading differs.\");\n if ((report.mobile_missing_dom_tokens >= 12 && desktop.main_dom_words.length >= 20) ||\n (report.mobile_missing_dom_tokens >= 4 && desktop.main_dom_words.length >= 8 &&\n mobile.main_dom_words.length * 2 <= desktop.main_dom_words.length))\n add(\"mobile_main_text_less\", \"warning\", report.mobile_missing_dom_tokens,\n \"Some distinct main-content words present on desktop are absent from the mobile DOM sample.\");\n if (report.mobile_missing_visible_tokens >= 12 && desktop.main_visible_words.length >= 20)\n add(\"mobile_visible_main_text_less\", \"info\", report.mobile_missing_visible_tokens,\n \"Some main-content words visibly present on desktop were not visibly rendered at the mobile viewport.\");\n if (mobile.main_dom_words.length >= 20 &&\n mobile.main_visible_words.length < Math.floor(mobile.main_dom_words.length * 0.5))\n add(\"mobile_content_visibility_gap\", \"info\",\n mobile.main_dom_words.length - mobile.main_visible_words.length,\n \"Most sampled mobile DOM words are not visually exposed at this viewport; CSS hiding or disclosures may be intentional.\");\n if (desktop.visible_nav_links.length > mobile.visible_nav_links.length)\n add(\"mobile_navigation_less\", \"info\",\n desktop.visible_nav_links.length - mobile.visible_nav_links.length,\n \"Fewer navigation links are visible on mobile; check whether a collapsed menu exposes them without relying on scripting.\");\n if (report.mobile_missing_internal_links)\n add(\"mobile_links_less\", \"warning\", report.mobile_missing_internal_links,\n \"Some same-origin link targets exist on desktop but not in the mobile DOM snapshot.\");\n if (!report.canonicals_equivalent)\n add(\"mobile_canonical_mismatch\", \"warning\", 1,\n \"Mobile and desktop canonical preferences differ; check the effective HTML declarations.\");\n if (!report.robots_equivalent)\n add(\"mobile_robots_mismatch\", \"warning\", 1,\n \"Mobile and desktop robots noindex signals differ; check intended indexing behavior.\");\n if (mobile.jsonld_blocks < desktop.jsonld_blocks)\n add(\"mobile_structured_data_less\", \"info\", desktop.jsonld_blocks - mobile.jsonld_blocks,\n \"Fewer JSON-LD blocks are present in the mobile DOM; validate each version's structured data separately.\");\n if (mobile.visible_controls < desktop.visible_controls)\n add(\"mobile_controls_less\", \"info\", desktop.visible_controls - mobile.visible_controls,\n \"Fewer interactive controls are visible on mobile; responsive UI differences may be intentional.\");\n if (mobile.observed_keyboard_targets < desktop.observed_keyboard_targets)\n add(\"mobile_keyboard_targets_less\", \"info\",\n desktop.observed_keyboard_targets - mobile.observed_keyboard_targets,\n \"A smaller number of Tab targets was observed on mobile in this short isolated keyboard sample.\");\n if (mobile.small_visible_controls)\n add(\"mobile_small_targets\", \"info\", mobile.small_visible_controls,\n \"Some mobile controls are under 24 CSS pixels in width or height; spacing exemptions and WCAG conformance were not assessed.\");\n if (mobile.disclosure_toggled === false || desktop.disclosure_toggled === false)\n add(\"native_disclosure_parity\", \"warning\", 1,\n \"An inspected native details disclosure did not toggle in one viewport; verify behavior independently.\");\n if (report.blocked_resources)\n add(\"resource_loads_blocked\", \"info\", report.blocked_resources,\n \"External resource requests were blocked by this diagnostic, so framework hydration and external styles are unknown.\");\n if (mobile.sample_truncated || desktop.sample_truncated ||\n mobile.keyboard_incomplete || desktop.keyboard_incomplete)\n add(\"sample_limited\", \"info\", 1,\n \"A DOM, control or keyboard sample reached a fixed evidence limit or remained incomplete.\");\n all.sort((a, b) => (a.severity === b.severity ? 0 : a.severity === \"warning\" ? -1 : 1)\n || a.code.localeCompare(b.code));\n report.total_findings = all.length;\n report.findings = all.slice(0, MAX_PARITY_FINDINGS);\n report.findings_truncated = all.length > MAX_PARITY_FINDINGS;\n return report;\n}\n"]}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type ScreenshotBrowserRuntime } from "../../screenshot.js";
|
|
2
|
+
/** P1-12: bounded, browser-backed evidence from an inert, offline HTML sample. */
|
|
3
|
+
export declare const MAX_WCAG_HTML_BYTES = 180000;
|
|
4
|
+
export declare const MAX_WCAG_CONTROLS = 120;
|
|
5
|
+
export declare const MAX_WCAG_TAB_STEPS = 24;
|
|
6
|
+
export declare const MAX_WCAG_FINDINGS = 12;
|
|
7
|
+
export declare const WCAG_FINDING_CODES: readonly ["missing_accessible_name", "positive_tabindex", "aria_hidden_focusable", "custom_role_not_keyboard_focusable", "potential_focus_indicator_absent", "focus_outside_viewport", "summary_enter_not_toggled"];
|
|
8
|
+
export type WcagFindingCode = typeof WCAG_FINDING_CODES[number];
|
|
9
|
+
export declare const WCAG_EVIDENCE_TYPES: readonly ["rendered_dom", "keyboard_tab", "native_summary"];
|
|
10
|
+
export type WcagEvidenceType = typeof WCAG_EVIDENCE_TYPES[number];
|
|
11
|
+
export interface WcagControlEvidence {
|
|
12
|
+
index: number;
|
|
13
|
+
visible: boolean;
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
focusable: boolean;
|
|
16
|
+
name_present: boolean;
|
|
17
|
+
positive_tabindex: boolean;
|
|
18
|
+
aria_hidden: boolean;
|
|
19
|
+
custom_role_without_tab_stop: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface WcagFocusEvidence {
|
|
22
|
+
index: number;
|
|
23
|
+
outline_or_shadow_present: boolean;
|
|
24
|
+
inside_viewport: boolean;
|
|
25
|
+
opacity_zero: boolean;
|
|
26
|
+
summary: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface WcagRenderedSnapshot {
|
|
29
|
+
controls_seen: number;
|
|
30
|
+
controls: WcagControlEvidence[];
|
|
31
|
+
page_scripts_present: number;
|
|
32
|
+
}
|
|
33
|
+
export interface WcagFinding {
|
|
34
|
+
code: WcagFindingCode;
|
|
35
|
+
severity: "warning" | "info";
|
|
36
|
+
evidence: WcagEvidenceType;
|
|
37
|
+
control: number;
|
|
38
|
+
message: string;
|
|
39
|
+
}
|
|
40
|
+
export interface WcagInteractionReview {
|
|
41
|
+
scope: "offline_sandboxed_rendered_html";
|
|
42
|
+
browser_executed: boolean;
|
|
43
|
+
scripts_disabled: true;
|
|
44
|
+
viewport_width: number;
|
|
45
|
+
viewport_height: number;
|
|
46
|
+
resources_blocked: number;
|
|
47
|
+
scripts_present: number;
|
|
48
|
+
controls_seen: number;
|
|
49
|
+
controls_inspected: number;
|
|
50
|
+
controls_truncated: boolean;
|
|
51
|
+
visible_controls_without_name: number;
|
|
52
|
+
positive_tabindex_controls: number;
|
|
53
|
+
aria_hidden_focusable_controls: number;
|
|
54
|
+
custom_roles_without_tab_stop: number;
|
|
55
|
+
tab_steps: number;
|
|
56
|
+
unique_tab_targets: number;
|
|
57
|
+
focus_indicator_review_leads: number;
|
|
58
|
+
focus_outside_viewport: number;
|
|
59
|
+
native_summaries_tested: number;
|
|
60
|
+
native_summaries_toggled: number;
|
|
61
|
+
keyboard_sampling_incomplete: boolean;
|
|
62
|
+
coverage_limited: true;
|
|
63
|
+
limitations: string[];
|
|
64
|
+
total_findings: number;
|
|
65
|
+
findings: WcagFinding[];
|
|
66
|
+
findings_truncated: boolean;
|
|
67
|
+
error?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface WcagReviewOptions {
|
|
70
|
+
viewportWidth?: number;
|
|
71
|
+
viewportHeight?: number;
|
|
72
|
+
maxTabSteps?: number;
|
|
73
|
+
}
|
|
74
|
+
export declare function validateWcagInput(html: string, options?: WcagReviewOptions): {
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
maxTabSteps: number;
|
|
78
|
+
};
|
|
79
|
+
export declare function emptyWcagReview(options?: WcagReviewOptions): WcagInteractionReview;
|
|
80
|
+
/** Reduce only fixed-shape, no-content browser observations to deterministic findings. */
|
|
81
|
+
export declare function analyzeWcagEvidence(snapshot: WcagRenderedSnapshot, focusSamples: WcagFocusEvidence[], options: {
|
|
82
|
+
viewportWidth: number;
|
|
83
|
+
viewportHeight: number;
|
|
84
|
+
resourcesBlocked?: number;
|
|
85
|
+
tabSteps?: number;
|
|
86
|
+
nativeSummariesTested?: number;
|
|
87
|
+
nativeSummariesToggled?: number;
|
|
88
|
+
keyboardIncomplete?: boolean;
|
|
89
|
+
}): WcagInteractionReview;
|
|
90
|
+
/**
|
|
91
|
+
* Offline Chromium checks of supplied HTML: scripts disabled, network requests
|
|
92
|
+
* aborted, no link clicks, no form submissions, no browser profile reuse.
|
|
93
|
+
* The only Enter keypress is on a focused native HTML summary element.
|
|
94
|
+
*/
|
|
95
|
+
export declare function reviewWcagInteractions(html: string, options?: WcagReviewOptions, runtime?: ScreenshotBrowserRuntime): Promise<WcagInteractionReview>;
|