mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-24 04:39:06 -05:00
Tables with a download link stack on phones, the browser check covers the lookup, a hash typed in the search, breadcrumbs, previous and next across tabs, glossary terms and the 404 hint. validate_site budgets the Pagefind index pieces and takes the base path without mkdocs.yml. A test holds the picker to install.narrow() on 180 selections.
14 lines
712 B
JavaScript
14 lines
712 B
JavaScript
// Screenshot of one element of a page, to look at a component closely.
|
|
// node shot_element.mjs <url> <css selector> <out.png> [width] [light|dark]
|
|
import { chromium } from 'playwright-core';
|
|
|
|
const [url, selector, out, width = '390', scheme = 'light'] = process.argv.slice(2);
|
|
const browser = await chromium.launch({ executablePath: '/usr/bin/google-chrome' });
|
|
const page = await browser.newPage({ viewport: { width: Number(width), height: 900 }, colorScheme: scheme });
|
|
await page.goto(url, { waitUntil: 'networkidle' });
|
|
const element = page.locator(selector).first();
|
|
await element.scrollIntoViewIfNeeded();
|
|
await page.waitForTimeout(300);
|
|
await element.screenshot({ path: out });
|
|
await browser.close();
|