Skip to content

Commit 6a8cc2f

Browse files
committed
use puppeteer-extra
1 parent d4301fe commit 6a8cc2f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libs/chromium.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import type { Browser, PuppeteerLaunchOptions } from 'puppeteer-core'
1+
import type { Browser, LaunchOptions } from 'puppeteer-core'
22
import puppeteer from 'puppeteer-extra'
33
import StealthPlugin from 'puppeteer-extra-plugin-stealth'
44

55
// eslint-disable-next-line functional/no-expression-statements
66
puppeteer.use(StealthPlugin())
77

88
export const Chromium = (() => {
9-
const instances: WeakMap<PuppeteerLaunchOptions, Browser> = new WeakMap()
9+
const instances: WeakMap<LaunchOptions, Browser> = new WeakMap()
1010

11-
const createInstance = (options: PuppeteerLaunchOptions) => {
11+
const createInstance = (options: LaunchOptions) => {
1212
// eslint-disable-next-line functional/no-expression-statements
1313
console.log('&&&&&', 'new chromium instanse will be created')
1414
return puppeteer.launch(options)
1515
}
1616

1717
return {
18-
getInstance: async (options: PuppeteerLaunchOptions) => {
18+
getInstance: async (options: LaunchOptions) => {
1919
const fromCache = instances.get(options)
2020
const instance = fromCache
2121
? fromCache

0 commit comments

Comments
 (0)