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

Commit

Permalink
add chromeFlags options and add headless as default
Browse files Browse the repository at this point in the history
- fixes #146 pdf only works in headless mode
  • Loading branch information
gorangajic committed Aug 7, 2017
1 parent 7bd9ac6 commit 30e0f2b
Show file tree
Hide file tree
Showing 3 changed files with 3 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
1 change: 1 addition & 0 deletions src/chrome/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ 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,
})
return await CDP({ port: this.chromeInstance.port })
}
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export interface ChromelessOptions {
launchChrome?: boolean // auto-launch chrome (local) `true`
cdp?: CDPOptions
remote?: RemoteOptions | boolean
chromeFlags?: Array<string>
}

export interface Chrome {
Expand Down

0 comments on commit 30e0f2b

Please sign in to comment.