tracker
All repositories: gitoria
4.1 KB
// tests/realdata-m029.mjs — missions 029/030 (tracker#33/#34/#35), NOT the gate. Against a server on a COPY of live storage/// (tests/realdata-m028.sh or realdata-m026.sh starts one): every path of REAL_PATHS (comma list) loaded in headless Chrome at 390// and 1280 px, signed out and — with REAL_SID_FILE — signed in as the creator; full-page screenshot <REAL_OUT>/<name>-<in|out>-<w>.png// and the visible text <name>-<in|out>-<w>.txt (to LOOK at). Also prints, per load, the poster's and the Follow button's boxes and// the status pill's text + colours (mission 030), when the page has them.// Env: REAL_PORT, REAL_CHROME (one debug port), REAL_SID_FILE (optional), REAL_OUT, REAL_PATHS, REAL_WIDTHS (390,1280).import { writeFileSync, readFileSync, mkdirSync } from 'node:fs';import { launchBrowser } from './cdp.mjs';process.env.HL_CHROME ||= '/opt/google/chrome/chrome';const PORT = Number(process.env.REAL_PORT || 8730), BASE = `http://127.0.0.1:${PORT}`, OUT = process.env.REAL_OUT;const SID = process.env.REAL_SID_FILE ? readFileSync(process.env.REAL_SID_FILE, 'utf8').trim() : null;const PATHS = process.env.REAL_PATHS.split(','), WIDTHS = (process.env.REAL_WIDTHS || '390,1280').split(',').map(Number);mkdirSync(OUT, { recursive: true });const nameOf = (p) => p.slice(1).replace(/[^A-Za-z0-9-]+/g, '_');const browser = await launchBrowser({ debugPortRange: [Number(process.env.REAL_CHROME || 8729), Number(process.env.REAL_CHROME || 8729)] });try {for (const who of SID ? ['out', 'in'] : ['out']) {const page = await browser.newPage();if (who === 'in') await page.send('Network.setCookie', { name: 'trackersid', value: SID, url: BASE });for (const w of WIDTHS) {await page.send('Emulation.setDeviceMetricsOverride', { width: w, height: 900, deviceScaleFactor: 1, mobile: w < 600 });for (const p of PATHS) {const t = Date.now();await page.goto(BASE + p, { timeout: 120000 });await page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1 && document.readyState === "complete"', { timeout: 120000, label: 'hydrated' });// an incomplete title completes on open (skeleton → full): wait until no skeleton is left (max 60 s)await page.waitFor(`!document.querySelector('#showloading')`, { timeout: 60000, label: 'complete' }).catch(() => {});await page.waitFor(`Array.from(document.querySelectorAll('img')).every(i => i.complete)`, { timeout: 15000, label: 'images' }).catch(() => {});const ms = Date.now() - t;const info = await page.evaluate(`(() => {const box = (el) => { if (!el) return null; const r = el.getBoundingClientRect(); return { x: Math.round(r.x), y: Math.round(r.y), w: Math.round(r.width), h: Math.round(r.height) }; };const poster = document.querySelector('show-poster img, show-poster skeleton-poster');const follow = document.querySelector('#follow');const pill = document.querySelector('.status-pill');const cs = pill ? getComputedStyle(pill) : null;return JSON.stringify({ poster: box(poster), posterSrc: poster && poster.getAttribute('src'), follow: box(follow), followText: follow && follow.textContent.trim(),pill: pill ? { text: pill.textContent.trim(), bg: cs.backgroundColor, color: cs.color, border: cs.borderTopWidth + ' ' + cs.borderTopStyle, box: box(pill) } : null,h1: box(document.querySelector('h1')), scrollX: document.documentElement.scrollWidth > innerWidth });})()`);const name = `${nameOf(p)}-${who}-${w}`;writeFileSync(`${OUT}/${name}.txt`, await page.evaluate('document.body.innerText'));const m = await page.send('Page.getLayoutMetrics');const h = Math.min(Math.ceil(m.cssContentSize.height), 6000);const shot = await page.send('Page.captureScreenshot', { format: 'png', captureBeyondViewport: true, clip: { x: 0, y: 0, width: w, height: h, scale: 1 } });writeFileSync(`${OUT}/${name}.png`, Buffer.from(shot.data, 'base64'));console.log(`${name} ${ms} ms ${info}`);}}await page.close().catch(() => {});}} finally { await browser.close().catch(() => {}); }process.exit(0);
Branches
Latest commits
- 8d3b0f20widget: the franchise link's 44 px tap area no longer overlaps the Prequel/Sequel rowmre
- 1d98dcfdbrowser gate: the badges' size check reads the padding box (the 44 px tap area is transparent border)mre
- 2f9e29ffreports/MK-mobile.md, deploy.sh GATES: tests/mobile.mjs, theme check markermre
- 7cfc8ab5a season of more than 150 episodes starts closed on its title page; the phone gate checks itmre
- 59095c59tests/mobile.mjs: the phone gate (390 px touch, tap targets, /franchises paging)mre
- 105309detap targets: every row link, the TMDB/IMDb badges, the widget links, the franchise names and the login-failed link are 44 px high on a phonemre
- f0b86c8efranchises: 40 loose timelines per page (/franchises/page/N) and a merge sort for the names (1,546 timelines: 20 s and 54,000 px before)mre
- b9e841a7Merge branch 'sy-sync'mre
- d1ae2701sync components.hybriel 4922f9c: modal and pagination 44 px targets (vendored copies, verbatim) (SY)mre
- 043624b2theme: sync from layouts 4994037 (list rows stack, td word-keep, heading code, edited tap target)mre
- 05d89fd0deploy: security gate (tests/security.mjs)mre
- 2ae8a47bMerge branch 'sk-sec'mre
- 8fee5d52sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
- 944ad51eSK: report reports/SK-sec.md, LOGsk
- 415487c1SK: import budget per user + id type check, gate checkssk
- 7b8a4f74security audit SK: nosniff + image sandbox headers, face id checks, adult follow, login budget + new session at login, guest-link budget, tests/security.mjssk
- f0f26c5areports: T18 section (gates, boot-gate, 3x3 table, search + short-id compare)mre
- 2a8682a1deploy.sh GATES: tests/warmstart.mjsmre
- 3761338breports/T17-boot.md: handoff (phase table, fix, numbers so far, open proof)mre
- 52e09eb2boot: sync window 1000 ms (the gates ask for a complete start), README boot-time sectionmre