Skip to content

Commit

Permalink
chore(core): change default chromium channel
Browse files Browse the repository at this point in the history
  • Loading branch information
ourongxing committed Dec 20, 2022
1 parent fcb3c93 commit 68e3525
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export class Printer {
const context = await chromium.launchPersistentContext(
this.contextOptions.userDataDir ?? "userData",
{
channel: "chrome",
...this.contextOptions,
headless: false
}
Expand All @@ -40,6 +41,7 @@ export class Printer {
const context = await chromium.launchPersistentContext(
userDataDir ?? "userData",
{
channel: "chrome",
colorScheme: "light",
...contextOptions
}
Expand Down Expand Up @@ -93,6 +95,7 @@ export class Printer {
const context = await chromium.launchPersistentContext(
userDataDir ?? "userData",
{
channel: "chrome",
...contextOptions
}
)
Expand Down
16 changes: 15 additions & 1 deletion packages/core/src/typings/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,21 @@ export interface PrinterPrintOption extends PrintOption {

export interface PrinterOption extends BrowserContextOptions {
/**
* Dir of userdata of Chromium
* Chromium distribution channel. Choose you have installed.
* @default "chrome"
* */
channel?:
| "chromium"
| "chrome"
| "chrome-beta"
| "chrome-dev"
| "chrome-canary"
| "msedge"
| "msedge-beta"
| "msedge-dev"
| "msedge-canary"
/**
* Dir of userdata of Browser. It is not recommended to use your system userData of Browser.
* @default "./userData"
*/
userDataDir?: string
Expand Down

0 comments on commit 68e3525

Please sign in to comment.