feat(dev): add argument bypassCSP to use in pupperter (#635)
This commit is contained in:
parent
b895437458
commit
38976558f5
1 changed files with 7 additions and 1 deletions
|
|
@ -30,6 +30,7 @@ const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification
|
|||
* @param {number} options.takeoverTimeoutMs - How much time to wait before taking over the session
|
||||
* @param {string} options.userAgent - User agent to use in puppeteer
|
||||
* @param {string} options.ffmpegPath - Ffmpeg path to use when formating videos to webp while sending stickers
|
||||
* @param {boolean} options.bypassCSP - Sets bypassing of page's Content-Security-Policy.
|
||||
*
|
||||
* @fires Client#qr
|
||||
* @fires Client#authenticated
|
||||
|
|
@ -82,6 +83,10 @@ class Client extends EventEmitter {
|
|||
}, this.options.session);
|
||||
}
|
||||
|
||||
if(this.options.bypassCSP) {
|
||||
await page.setBypassCSP(true);
|
||||
}
|
||||
|
||||
await page.goto(WhatsWebURL, {
|
||||
waitUntil: 'load',
|
||||
timeout: 0,
|
||||
|
|
|
|||
Loading…
Reference in a new issue