We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63191ab commit a4e863aCopy full SHA for a4e863a
api/_lib/chromium.ts
@@ -1,12 +1,14 @@
1
import { launch, Page } from 'puppeteer-core';
2
-import { getOptions } from './options';
+import chrome from 'chrome-aws-lambda';
3
let _page: Page | null;
4
5
async function getPage() {
6
- if (_page) {
7
- return _page;
8
- }
9
- const options = await getOptions(false);
+ if (_page) return _page;
+ const options = {
+ args: chrome.args,
+ executablePath: await chrome.executablePath,
10
+ headless: chrome.headless
11
+ };
12
const browser = await launch(options);
13
_page = await browser.newPage();
14
return _page;
0 commit comments