21 lines
675 B
JavaScript
21 lines
675 B
JavaScript
import { chromium } from 'playwright';
|
|
import { fileURLToPath } from 'url';
|
|
import path from 'path';
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
const htmlPath = path.join(__dirname, 'index.html');
|
|
|
|
const browser = await chromium.launch({
|
|
executablePath: '/etc/profiles/per-user/myrmidex/bin/chromium',
|
|
args: ['--no-sandbox'],
|
|
});
|
|
|
|
const page = await browser.newPage();
|
|
await page.setViewportSize({ width: 1200, height: 400 });
|
|
await page.goto(`file://${htmlPath}`);
|
|
await page.waitForTimeout(1000); // let font load
|
|
|
|
await page.screenshot({ path: path.join(__dirname, 'logo-full.png') });
|
|
console.log('Saved logo-full.png');
|
|
|
|
await browser.close();
|