aboutsummaryrefslogtreecommitdiffstats
path: root/tools/offline-cache-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/offline-cache-test.js')
-rw-r--r--tools/offline-cache-test.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/offline-cache-test.js b/tools/offline-cache-test.js
index c01dc1c..ffa42e4 100644
--- a/tools/offline-cache-test.js
+++ b/tools/offline-cache-test.js
@@ -4,7 +4,7 @@
// build from dist/ so the service worker serves the shell offline.
//
// Run: bun run build && bun tools/offline-cache-test.js
-import puppeteer from 'puppeteer-core';
+import puppeteer from './puppeteer.js';
import { generateMnemonic } from '@scure/bip39';
import { wordlist } from '@scure/bip39/wordlists/english';
import { join } from 'node:path';
@@ -16,7 +16,7 @@ const server = Bun.serve({ port: 5234, async fetch(req) {
if (await f.exists()) return new Response(f, { headers: { 'cache-control': 'no-store' } });
return new Response(Bun.file(dist + '/index.html'), { headers: { 'cache-control': 'no-store' } });
} });
-const browser = await puppeteer.launch({ executablePath: '/usr/bin/google-chrome', headless: 'new', args: ['--no-sandbox'] });
+const browser = await puppeteer.launch({ relays: 'read', executablePath: '/usr/bin/google-chrome', headless: 'new', args: ['--no-sandbox'] });
const page = await browser.newPage();
const errs = []; page.on('pageerror', (e) => errs.push(e.message)); page.on('console', (m) => { if (m.type() === 'error') errs.push('console: ' + m.text().slice(0, 160)); });
const click = (sel, t) => page.evaluate((s, x) => { const e = [...document.querySelectorAll(s)].find((n) => n.textContent.trim().toLowerCase().includes(x.toLowerCase())); if (e) { e.click(); return true; } return false; }, sel, t);