You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
changedetection.io/playwright/server.js

11 lines
572 B

const playwright = require('playwright');
const port = parseInt(process.env.PLAYWRIGHT_PORT) || 4444;
const browserType = process.env.PLAYWRIGHT_BROWSER_TYPE?.toLowerCase() || 'chromium';
const headless = process.env.PLAYWRIGHT_HEADLESS?.toLowerCase() === 'true' || true;
const wsPath = 'playwright';
console.log('using port:', port, 'browser:', browserType, 'headless:', headless, 'wspath:', wsPath);
const serverPromise = playwright[browserType].launchServer({ headless: headless, port: port, wsPath: wsPath });
serverPromise.then(bs => console.log(bs.wsEndpoint()));