mirror of
https://github.com/hanzoai/puppeteer.git
synced 2026-09-24 17:02:14 +00:00
17 lines
474 B
JavaScript
17 lines
474 B
JavaScript
/**
|
|
* @license
|
|
* Copyright 2024 Google Inc.
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
import {pathToFileURL} from 'node:url';
|
|
|
|
const [, , puppeteerRoot, options] = process.argv;
|
|
const puppeteer = (await import(pathToFileURL(puppeteerRoot))).default;
|
|
const browser = await puppeteer.launch(JSON.parse(options));
|
|
const page = await browser.newPage();
|
|
await page.evaluate(() => {
|
|
return console.error('message from dumpio');
|
|
});
|
|
await page.close();
|
|
await browser.close();
|