Skip to content

Commit a4e863a

Browse files
authored
Update chromium.ts
1 parent 63191ab commit a4e863a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

api/_lib/chromium.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { launch, Page } from 'puppeteer-core';
2-
import { getOptions } from './options';
2+
import chrome from 'chrome-aws-lambda';
33
let _page: Page | null;
44

55
async function getPage() {
6-
if (_page) {
7-
return _page;
8-
}
9-
const options = await getOptions(false);
6+
if (_page) return _page;
7+
const options = {
8+
args: chrome.args,
9+
executablePath: await chrome.executablePath,
10+
headless: chrome.headless
11+
};
1012
const browser = await launch(options);
1113
_page = await browser.newPage();
1214
return _page;

0 commit comments

Comments
 (0)