File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ import chrome from 'chrome-aws-lambda' ;
2+ const exePath = process . platform === 'win32'
3+ ? 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
4+ : process . platform === 'linux'
5+ ? '/usr/bin/google-chrome'
6+ : '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' ;
7+
8+ interface Options {
9+ args : string [ ] ;
10+ executablePath : string ;
11+ headless : boolean ;
12+ }
13+
14+ export async function getOptions ( isDev : boolean ) {
15+ let options : Options ;
16+ if ( isDev ) {
17+ options = {
18+ args : [ ] ,
19+ executablePath : exePath ,
20+ headless : true
21+ } ;
22+ } else {
23+ options = {
24+ args : chrome . args ,
25+ executablePath : await chrome . executablePath ,
26+ headless : chrome . headless ,
27+ } ;
28+ }
29+ return options ;
30+ }
You can’t perform that action at this time.
0 commit comments