wechaty / puppet-wechat

Wechaty Puppet Provider for WeChat
https://www.npmjs.com/package/wechaty-puppet-wechat
Apache License 2.0
408 stars 68 forks source link

puppetOptions参数拓展 支持 browserless #162

Open humorwang opened 2 years ago

humorwang commented 2 years ago

我想是否可以puppetOptions 参数设置参数拓展,让开发时使用puppeteer.launch(); 而正式环境使用 puppeteer.connect(); 本地的chromium 非常吃内存,对低配置服务器非常不友好,而 browserless/chrome:latest 对低配置服务器比较友好。

huan commented 2 years ago

Thanks for sharing your thoughts, I think it's a good idea!

I believe we can use "browserless/chrome:latest" by default if they use fewer resources.

You can refer to the below source code:

https://github.com/wechaty/puppet-wechat/blob/e34c8a1a998e045814b3dff052f74385de7a464b/src/puppet-wechat.ts#L109-L113

We can only use "本地的chromium 非常吃内存,对低配置服务器非常不友好" when the options.head is true.