mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
feat(dev): add argument bypassCSP to use in pupperter (#635)
This commit is contained in:
committed by
GitHub
parent
b895437458
commit
38976558f5
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user