Skip to content
This repository has been archived by the owner on Nov 24, 2018. It is now read-only.

Commit

Permalink
add chromeFlags, chromePath and --headless as default
Browse files Browse the repository at this point in the history
- fixes #146 pdf only works in headless mode
- fixes #184 Add chromePath and chromeFlags to ChromelessOptions
  • Loading branch information
gorangajic committed Aug 7, 2017
1 parent 7bd9ac6 commit 21064a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default class Chromeless<T extends any> implements Promise<T> {
closeTab: true,
...options.cdp,
},
chromeFlags: ['--headless'],
}

const chrome = mergedOptions.remote
Expand Down
2 changes: 2 additions & 0 deletions src/chrome/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export default class LocalChrome implements Chrome {
this.chromeInstance = await launch({
logLevel: this.options.debug ? 'info' : 'silent',
port: this.options.cdp.port,
chromeFlags: this.options.chromeFlags,
chromePath: this.options.chromePath,
})
return await CDP({ port: this.chromeInstance.port })
}
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export interface ChromelessOptions {
launchChrome?: boolean // auto-launch chrome (local) `true`
cdp?: CDPOptions
remote?: RemoteOptions | boolean
chromeFlags?: Array<string> // ['--headless']
chromePath?: string
}

export interface Chrome {
Expand Down

0 comments on commit 21064a9

Please sign in to comment.