diff --git a/docs/Base.html b/docs/Base.html
index 53e96d3..431e533 100644
--- a/docs/Base.html
+++ b/docs/Base.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Base
+ whatsapp-web.js 1.15.6 » Class: Base
@@ -15,7 +15,7 @@
@@ -50,7 +50,7 @@
diff --git a/docs/BusinessContact.html b/docs/BusinessContact.html
index 27444b8..32f1ef2 100644
--- a/docs/BusinessContact.html
+++ b/docs/BusinessContact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: BusinessContact
+ whatsapp-web.js 1.15.6 » Class: BusinessContact
@@ -15,7 +15,7 @@
@@ -314,7 +314,7 @@
diff --git a/docs/Buttons.html b/docs/Buttons.html
index 782fd95..a6e6b29 100644
--- a/docs/Buttons.html
+++ b/docs/Buttons.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Buttons
+ whatsapp-web.js 1.15.6 » Class: Buttons
@@ -15,7 +15,7 @@
@@ -234,7 +234,7 @@ Returns: [{ buttonId:'customId',buttonText:{'displayText':
diff --git a/docs/Call.html b/docs/Call.html
index 67aec23..5e027ba 100644
--- a/docs/Call.html
+++ b/docs/Call.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Call
+ whatsapp-web.js 1.15.6 » Class: Call
@@ -15,7 +15,7 @@
@@ -144,7 +144,7 @@
diff --git a/docs/Chat.html b/docs/Chat.html
index 3106161..ba808ca 100644
--- a/docs/Chat.html
+++ b/docs/Chat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Chat
+ whatsapp-web.js 1.15.6 » Class: Chat
@@ -15,7 +15,7 @@
@@ -483,7 +483,7 @@
diff --git a/docs/Client.html b/docs/Client.html
index 377d2a5..e05aad7 100644
--- a/docs/Client.html
+++ b/docs/Client.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Client
+ whatsapp-web.js 1.15.6 » Class: Client
@@ -15,7 +15,7 @@
@@ -2416,7 +2416,7 @@
diff --git a/docs/Client.js.html b/docs/Client.js.html
index af18091..5616fe9 100644
--- a/docs/Client.js.html
+++ b/docs/Client.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: Client.js
+ whatsapp-web.js 1.15.6 » Source: Client.js
@@ -15,7 +15,7 @@
@@ -105,7 +105,7 @@ class Client extends EventEmitter {
} else {
browser = await puppeteer.launch(this.options.puppeteer);
page = (await browser.pages())[0];
- }
+ }
await page.setUserAgent(this.options.userAgent);
@@ -120,11 +120,13 @@ class Client extends EventEmitter {
if (this.options.session) {
await page.evaluateOnNewDocument(
session => {
- localStorage.clear();
- localStorage.setItem('WABrowserId', session.WABrowserId);
- localStorage.setItem('WASecretBundle', session.WASecretBundle);
- localStorage.setItem('WAToken1', session.WAToken1);
- localStorage.setItem('WAToken2', session.WAToken2);
+ if(document.referrer === 'https://whatsapp.com/') {
+ localStorage.clear();
+ localStorage.setItem('WABrowserId', session.WABrowserId);
+ localStorage.setItem('WASecretBundle', session.WASecretBundle);
+ localStorage.setItem('WAToken1', session.WAToken1);
+ localStorage.setItem('WAToken2', session.WAToken2);
+ }
}, this.options.session);
}
@@ -135,6 +137,7 @@ class Client extends EventEmitter {
await page.goto(WhatsWebURL, {
waitUntil: 'load',
timeout: 0,
+ referer: 'https://whatsapp.com/'
});
const KEEP_PHONE_CONNECTED_IMG_SELECTOR = '[data-icon="intro-md-beta-logo-dark"], [data-icon="intro-md-beta-logo-light"], [data-asset-intro-image-light="true"], [data-asset-intro-image-dark="true"]';
@@ -483,7 +486,7 @@ class Client extends EventEmitter {
// Disconnect when navigating away when in PAIRING state (detect logout)
this.pupPage.on('framenavigated', async () => {
const appState = await this.getState();
- if(appState === WAState.PAIRING) {
+ if(!appState || appState === WAState.PAIRING) {
this.emit(Events.DISCONNECTED, 'NAVIGATION');
await this.destroy();
}
@@ -758,6 +761,7 @@ class Client extends EventEmitter {
*/
async getState() {
return await this.pupPage.evaluate(() => {
+ if(!window.Store) return null;
return window.Store.AppState.state;
});
}
@@ -1065,7 +1069,7 @@ module.exports = Client;
diff --git a/docs/ClientInfo.html b/docs/ClientInfo.html
index ebd3915..1ea8a5e 100644
--- a/docs/ClientInfo.html
+++ b/docs/ClientInfo.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: ClientInfo
+ whatsapp-web.js 1.15.6 » Class: ClientInfo
@@ -15,7 +15,7 @@
@@ -238,7 +238,7 @@
diff --git a/docs/Contact.html b/docs/Contact.html
index fefc8a4..e5d77bc 100644
--- a/docs/Contact.html
+++ b/docs/Contact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Contact
+ whatsapp-web.js 1.15.6 » Class: Contact
@@ -15,7 +15,7 @@
@@ -281,7 +281,7 @@
diff --git a/docs/GroupChat.html b/docs/GroupChat.html
index 77840d8..b697aca 100644
--- a/docs/GroupChat.html
+++ b/docs/GroupChat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: GroupChat
+ whatsapp-web.js 1.15.6 » Class: GroupChat
@@ -15,7 +15,7 @@
@@ -921,7 +921,7 @@
diff --git a/docs/GroupNotification.html b/docs/GroupNotification.html
index 014b483..f446b0b 100644
--- a/docs/GroupNotification.html
+++ b/docs/GroupNotification.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: GroupNotification
+ whatsapp-web.js 1.15.6 » Class: GroupNotification
@@ -15,7 +15,7 @@
@@ -233,7 +233,7 @@
diff --git a/docs/InterfaceController.html b/docs/InterfaceController.html
index 16ef127..d351316 100644
--- a/docs/InterfaceController.html
+++ b/docs/InterfaceController.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: InterfaceController
+ whatsapp-web.js 1.15.6 » Class: InterfaceController
@@ -15,7 +15,7 @@
@@ -382,7 +382,7 @@
diff --git a/docs/Label.html b/docs/Label.html
index 8393b50..fa8a910 100644
--- a/docs/Label.html
+++ b/docs/Label.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Label
+ whatsapp-web.js 1.15.6 » Class: Label
@@ -15,7 +15,7 @@
@@ -163,7 +163,7 @@
diff --git a/docs/List.html b/docs/List.html
index 2e26fb1..1d8156c 100644
--- a/docs/List.html
+++ b/docs/List.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: List
+ whatsapp-web.js 1.15.6 » Class: List
@@ -15,7 +15,7 @@
@@ -256,7 +256,7 @@ Returns: [{'title':'sectionTitle','rows':[{'r
diff --git a/docs/Location.html b/docs/Location.html
index 1c7447b..6a672e8 100644
--- a/docs/Location.html
+++ b/docs/Location.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Location
+ whatsapp-web.js 1.15.6 » Class: Location
@@ -15,7 +15,7 @@
@@ -149,7 +149,7 @@
diff --git a/docs/Message.html b/docs/Message.html
index 72da777..d9b2f59 100644
--- a/docs/Message.html
+++ b/docs/Message.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Message
+ whatsapp-web.js 1.15.6 » Class: Message
@@ -15,7 +15,7 @@
@@ -580,7 +580,7 @@
diff --git a/docs/MessageMedia.html b/docs/MessageMedia.html
index c8e2222..0442fd7 100644
--- a/docs/MessageMedia.html
+++ b/docs/MessageMedia.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: MessageMedia
+ whatsapp-web.js 1.15.6 » Class: MessageMedia
@@ -15,7 +15,7 @@
@@ -343,7 +343,7 @@
diff --git a/docs/Order.html b/docs/Order.html
index 1286a62..39a3668 100644
--- a/docs/Order.html
+++ b/docs/Order.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Order
+ whatsapp-web.js 1.15.6 » Class: Order
@@ -15,7 +15,7 @@
@@ -102,7 +102,7 @@
diff --git a/docs/PrivateChat.html b/docs/PrivateChat.html
index f7fd2bc..0990185 100644
--- a/docs/PrivateChat.html
+++ b/docs/PrivateChat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: PrivateChat
+ whatsapp-web.js 1.15.6 » Class: PrivateChat
@@ -15,7 +15,7 @@
@@ -519,7 +519,7 @@
diff --git a/docs/PrivateContact.html b/docs/PrivateContact.html
index b43118f..388084a 100644
--- a/docs/PrivateContact.html
+++ b/docs/PrivateContact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: PrivateContact
+ whatsapp-web.js 1.15.6 » Class: PrivateContact
@@ -15,7 +15,7 @@
@@ -307,7 +307,7 @@
diff --git a/docs/Product.html b/docs/Product.html
index 8cc011b..6359b7a 100644
--- a/docs/Product.html
+++ b/docs/Product.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Product
+ whatsapp-web.js 1.15.6 » Class: Product
@@ -15,7 +15,7 @@
@@ -127,7 +127,7 @@
diff --git a/docs/Util.html b/docs/Util.html
index 03f11e2..696d76d 100644
--- a/docs/Util.html
+++ b/docs/Util.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Util
+ whatsapp-web.js 1.15.6 » Class: Util
@@ -15,7 +15,7 @@
@@ -243,7 +243,7 @@
diff --git a/docs/global.html b/docs/global.html
index dd44936..b373bf7 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Globals
+ whatsapp-web.js 1.15.6 » Globals
@@ -15,7 +15,7 @@
@@ -1980,7 +1980,7 @@
diff --git a/docs/index.html b/docs/index.html
index 00df7b1..aa8315c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Home
+ whatsapp-web.js 1.15.6 » Home
@@ -15,7 +15,7 @@
@@ -27,7 +27,7 @@
@@ -3031,7 +3031,7 @@ client.initialize();
diff --git a/docs/structures_Base.js.html b/docs/structures_Base.js.html
index 49d7a9c..d2a8249 100644
--- a/docs/structures_Base.js.html
+++ b/docs/structures_Base.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Base.js
+ whatsapp-web.js 1.15.6 » Source: structures/Base.js
@@ -15,7 +15,7 @@
@@ -60,7 +60,7 @@ module.exports = Base;
diff --git a/docs/structures_BusinessContact.js.html b/docs/structures_BusinessContact.js.html
index f857e70..9f69b7e 100644
--- a/docs/structures_BusinessContact.js.html
+++ b/docs/structures_BusinessContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/BusinessContact.js
+ whatsapp-web.js 1.15.6 » Source: structures/BusinessContact.js
@@ -15,7 +15,7 @@
@@ -59,7 +59,7 @@ module.exports = BusinessContact;
diff --git a/docs/structures_Buttons.js.html b/docs/structures_Buttons.js.html
index 603fa19..1fb8ace 100644
--- a/docs/structures_Buttons.js.html
+++ b/docs/structures_Buttons.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Buttons.js
+ whatsapp-web.js 1.15.6 » Source: structures/Buttons.js
@@ -15,7 +15,7 @@
@@ -120,7 +120,7 @@ module.exports = Buttons;
diff --git a/docs/structures_Call.js.html b/docs/structures_Call.js.html
index 0169422..77a86e1 100644
--- a/docs/structures_Call.js.html
+++ b/docs/structures_Call.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Call.js
+ whatsapp-web.js 1.15.6 » Source: structures/Call.js
@@ -15,7 +15,7 @@
@@ -106,7 +106,7 @@ module.exports = Call;
diff --git a/docs/structures_Chat.js.html b/docs/structures_Chat.js.html
index 1bd0a93..917d234 100644
--- a/docs/structures_Chat.js.html
+++ b/docs/structures_Chat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Chat.js
+ whatsapp-web.js 1.15.6 » Source: structures/Chat.js
@@ -15,7 +15,7 @@
@@ -290,7 +290,7 @@ module.exports = Chat;
diff --git a/docs/structures_ClientInfo.js.html b/docs/structures_ClientInfo.js.html
index 27594ea..1bea899 100644
--- a/docs/structures_ClientInfo.js.html
+++ b/docs/structures_ClientInfo.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/ClientInfo.js
+ whatsapp-web.js 1.15.6 » Source: structures/ClientInfo.js
@@ -15,7 +15,7 @@
@@ -108,7 +108,7 @@ module.exports = ClientInfo;
diff --git a/docs/structures_Contact.js.html b/docs/structures_Contact.js.html
index 203c3ea..951e985 100644
--- a/docs/structures_Contact.js.html
+++ b/docs/structures_Contact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Contact.js
+ whatsapp-web.js 1.15.6 » Source: structures/Contact.js
@@ -15,7 +15,7 @@
@@ -236,7 +236,7 @@ module.exports = Contact;
diff --git a/docs/structures_GroupChat.js.html b/docs/structures_GroupChat.js.html
index 94e206f..cc2daf6 100644
--- a/docs/structures_GroupChat.js.html
+++ b/docs/structures_GroupChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/GroupChat.js
+ whatsapp-web.js 1.15.6 » Source: structures/GroupChat.js
@@ -15,7 +15,7 @@
@@ -239,7 +239,7 @@ module.exports = GroupChat;
diff --git a/docs/structures_GroupNotification.js.html b/docs/structures_GroupNotification.js.html
index 0911156..c36ffb4 100644
--- a/docs/structures_GroupNotification.js.html
+++ b/docs/structures_GroupNotification.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/GroupNotification.js
+ whatsapp-web.js 1.15.6 » Source: structures/GroupNotification.js
@@ -15,7 +15,7 @@
@@ -143,7 +143,7 @@ module.exports = GroupNotification;
diff --git a/docs/structures_Label.js.html b/docs/structures_Label.js.html
index 223cc7a..d0ddbda 100644
--- a/docs/structures_Label.js.html
+++ b/docs/structures_Label.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Label.js
+ whatsapp-web.js 1.15.6 » Source: structures/Label.js
@@ -15,7 +15,7 @@
@@ -88,7 +88,7 @@ module.exports = Label;
diff --git a/docs/structures_List.js.html b/docs/structures_List.js.html
index dfbdb35..600a35a 100644
--- a/docs/structures_List.js.html
+++ b/docs/structures_List.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/List.js
+ whatsapp-web.js 1.15.6 » Source: structures/List.js
@@ -15,7 +15,7 @@
@@ -118,7 +118,7 @@ module.exports = List;
diff --git a/docs/structures_Location.js.html b/docs/structures_Location.js.html
index 9479935..351ab27 100644
--- a/docs/structures_Location.js.html
+++ b/docs/structures_Location.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Location.js
+ whatsapp-web.js 1.15.6 » Source: structures/Location.js
@@ -15,7 +15,7 @@
@@ -71,7 +71,7 @@ module.exports = Location;
diff --git a/docs/structures_Message.js.html b/docs/structures_Message.js.html
index d25e780..38ec6bd 100644
--- a/docs/structures_Message.js.html
+++ b/docs/structures_Message.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Message.js
+ whatsapp-web.js 1.15.6 » Source: structures/Message.js
@@ -15,7 +15,7 @@
@@ -525,7 +525,7 @@ module.exports = Message;
diff --git a/docs/structures_MessageMedia.js.html b/docs/structures_MessageMedia.js.html
index 1c20f5a..da84bcd 100644
--- a/docs/structures_MessageMedia.js.html
+++ b/docs/structures_MessageMedia.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/MessageMedia.js
+ whatsapp-web.js 1.15.6 » Source: structures/MessageMedia.js
@@ -15,7 +15,7 @@
@@ -142,7 +142,7 @@ module.exports = MessageMedia;
diff --git a/docs/structures_Order.js.html b/docs/structures_Order.js.html
index b6f6fd7..fd519bd 100644
--- a/docs/structures_Order.js.html
+++ b/docs/structures_Order.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Order.js
+ whatsapp-web.js 1.15.6 » Source: structures/Order.js
@@ -15,7 +15,7 @@
@@ -90,7 +90,7 @@ module.exports = Order;
diff --git a/docs/structures_Payment.js.html b/docs/structures_Payment.js.html
index c5a8dcc..d513f0f 100644
--- a/docs/structures_Payment.js.html
+++ b/docs/structures_Payment.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Payment.js
+ whatsapp-web.js 1.15.6 » Source: structures/Payment.js
@@ -15,7 +15,7 @@
@@ -118,7 +118,7 @@ module.exports = Payment;
diff --git a/docs/structures_PrivateChat.js.html b/docs/structures_PrivateChat.js.html
index b651081..0db9881 100644
--- a/docs/structures_PrivateChat.js.html
+++ b/docs/structures_PrivateChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/PrivateChat.js
+ whatsapp-web.js 1.15.6 » Source: structures/PrivateChat.js
@@ -15,7 +15,7 @@
@@ -51,7 +51,7 @@ module.exports = PrivateChat;
diff --git a/docs/structures_PrivateContact.js.html b/docs/structures_PrivateContact.js.html
index c5c5519..17ced7e 100644
--- a/docs/structures_PrivateContact.js.html
+++ b/docs/structures_PrivateContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/PrivateContact.js
+ whatsapp-web.js 1.15.6 » Source: structures/PrivateContact.js
@@ -15,7 +15,7 @@
@@ -51,7 +51,7 @@ module.exports = PrivateContact;
diff --git a/docs/structures_Product.js.html b/docs/structures_Product.js.html
index c0cd2d4..ec9a754 100644
--- a/docs/structures_Product.js.html
+++ b/docs/structures_Product.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Product.js
+ whatsapp-web.js 1.15.6 » Source: structures/Product.js
@@ -15,7 +15,7 @@
@@ -106,7 +106,7 @@ module.exports = Product;
diff --git a/docs/structures_ProductMetadata.js.html b/docs/structures_ProductMetadata.js.html
index ed19db0..856fd1d 100644
--- a/docs/structures_ProductMetadata.js.html
+++ b/docs/structures_ProductMetadata.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/ProductMetadata.js
+ whatsapp-web.js 1.15.6 » Source: structures/ProductMetadata.js
@@ -15,7 +15,7 @@
@@ -63,7 +63,7 @@ module.exports = ProductMetadata;
diff --git a/docs/util_Constants.js.html b/docs/util_Constants.js.html
index 1d8d37d..165cd8b 100644
--- a/docs/util_Constants.js.html
+++ b/docs/util_Constants.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: util/Constants.js
+ whatsapp-web.js 1.15.6 » Source: util/Constants.js
@@ -15,7 +15,7 @@
@@ -200,7 +200,7 @@ exports.MessageAck = {
diff --git a/docs/util_InterfaceController.js.html b/docs/util_InterfaceController.js.html
index 81233f6..bac96c8 100644
--- a/docs/util_InterfaceController.js.html
+++ b/docs/util_InterfaceController.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: util/InterfaceController.js
+ whatsapp-web.js 1.15.6 » Source: util/InterfaceController.js
@@ -15,7 +15,7 @@
@@ -160,7 +160,7 @@ module.exports = InterfaceController;
diff --git a/docs/util_Util.js.html b/docs/util_Util.js.html
index 4edf4c1..8d4eb75 100644
--- a/docs/util_Util.js.html
+++ b/docs/util_Util.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: util/Util.js
+ whatsapp-web.js 1.15.6 » Source: util/Util.js
@@ -15,7 +15,7 @@
@@ -242,7 +242,7 @@ module.exports = Util;
diff --git a/package.json b/package.json
index f325999..9e45e3a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "whatsapp-web.js",
- "version": "1.15.5",
+ "version": "1.15.6",
"description": "Library for interacting with the WhatsApp Web API ",
"main": "./index.js",
"typings": "./index.d.ts",