🚑 修改puppeteer.devices引入方式防止低版本报错

This commit is contained in:
yeyang
2023-04-09 01:40:15 +08:00
parent 4e292e10b6
commit e9b6abb5b4

View File

@@ -1,9 +1,9 @@
import fs from 'fs'
import _ from 'lodash'
import { devices } from 'puppeteer'
import pet from '../../../../lib/puppeteer/puppeteer.js'
import { Config, Data, Plugin_Name, Version } from '../../components/index.js'
// 适配低版本puppeteer
const _puppeteer = await import('puppeteer')
let puppeteer = null
let StealthPlugin = null
try {
@@ -29,7 +29,7 @@ export default new (class newPuppeteer {
isLandscape: false
}
},
...devices
..._puppeteer.devices
}
this.browser = false
this.config = {