diff --git a/docs/Base.html b/docs/Base.html
index 6109dee..debfd50 100644
--- a/docs/Base.html
+++ b/docs/Base.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: Base
+ whatsapp-web.js 1.12.6 » Class: Base
@@ -15,7 +15,7 @@
@@ -50,7 +50,7 @@
diff --git a/docs/BusinessContact.html b/docs/BusinessContact.html
index bbc3171..201f9db 100644
--- a/docs/BusinessContact.html
+++ b/docs/BusinessContact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: BusinessContact
+ whatsapp-web.js 1.12.6 » Class: BusinessContact
@@ -15,7 +15,7 @@
@@ -290,7 +290,7 @@
diff --git a/docs/Chat.html b/docs/Chat.html
index a703a48..f2c8a72 100644
--- a/docs/Chat.html
+++ b/docs/Chat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: Chat
+ whatsapp-web.js 1.12.6 » Class: Chat
@@ -15,7 +15,7 @@
@@ -224,8 +224,7 @@
Returns
- Promise containing Boolean
-
result
+ Promise containing Boolean
result
@@ -240,8 +239,7 @@
Returns
- Promise containing Boolean
-
result
+ Promise containing Boolean
result
@@ -374,8 +372,7 @@
Returns
- Promise containing boolean
-
New pin state. Could be false if the max number of pinned chats was reached.
+ Promise containing boolean
New pin state. Could be false if the max number of pinned chats was reached.
@@ -426,8 +423,7 @@
Returns
- Promise containing Message
-
Message that was just sent
+ Promise containing Message
Message that was just sent
@@ -437,8 +433,7 @@
Returns
- Promise containing Boolean
-
result
+ Promise containing Boolean
result
@@ -468,8 +463,7 @@
Returns
- Promise containing boolean
-
New pin state
+ Promise containing boolean
New pin state
@@ -483,7 +477,7 @@
diff --git a/docs/Client.html b/docs/Client.html
index c2df37a..b4cc41e 100644
--- a/docs/Client.html
+++ b/docs/Client.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: Client
+ whatsapp-web.js 1.12.6 » Class: Client
@@ -15,7 +15,7 @@
@@ -533,8 +533,7 @@
Returns
- Promise containing string
-
Id of the joined Chat
+ Promise containing string
Id of the joined Chat
@@ -596,18 +595,15 @@
Returns
- Object
-
createRes
+ Object
createRes
- string
-
createRes.gid - ID for the group that was just created
+ string
createRes.gid - ID for the group that was just created
- Object with string properties
-
createRes.missingParticipants - participants that were not added to the group. Keys represent the ID for participant that was not added and its value is a status code that represents the reason why participant could not be added. This is usually 403 if the user's privacy settings don't allow you to add them to groups.
+ Object with string properties
createRes.missingParticipants - participants that were not added to the group. Keys represent the ID for participant that was not added and its value is a status code that represents the reason why participant could not be added. This is usually 403 if the user's privacy settings don't allow you to add them to groups.
@@ -816,8 +812,7 @@
Returns
- Promise containing object
-
Invite information
+ Promise containing object
Invite information
@@ -1098,8 +1093,7 @@
Returns
- Promise containing boolean
-
New pin state. Could be false if the max number of pinned chats was reached.
+ Promise containing boolean
New pin state. Could be false if the max number of pinned chats was reached.
@@ -1169,8 +1163,7 @@
Returns
- Promise containing Message
-
Message that was just sent
+ Promise containing Message
Message that was just sent
@@ -1213,8 +1206,7 @@
Returns
- Promise containing boolean
-
result
+ Promise containing boolean
result
@@ -1336,8 +1328,7 @@
Returns
- Promise containing boolean
-
New pin state
+ Promise containing boolean
New pin state
@@ -1599,13 +1590,13 @@
reason
- WAState
+ (WAState or "NAVIGATION")
- state that caused the disconnect
+ reason that caused the disconnect
@@ -1987,7 +1978,7 @@
diff --git a/docs/Client.js.html b/docs/Client.js.html
index 74d1656..939e205 100644
--- a/docs/Client.js.html
+++ b/docs/Client.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: Client.js
+ whatsapp-web.js 1.12.6 » Source: Client.js
@@ -15,7 +15,7 @@
@@ -147,18 +147,18 @@ class Client extends EventEmitter {
} else {
const getQrCode = async () => {
// Check if retry button is present
- var QR_RETRY_SELECTOR = 'div[data-ref] > span > div';
+ var QR_RETRY_SELECTOR = 'div[data-ref] > span > button';
var qrRetry = await page.$(QR_RETRY_SELECTOR);
if (qrRetry) {
await qrRetry.click();
}
// Wait for QR Code
-
const QR_CANVAS_SELECTOR = 'canvas';
await page.waitForSelector(QR_CANVAS_SELECTOR, { timeout: this.options.qrTimeoutMs });
const qrImgData = await page.$eval(QR_CANVAS_SELECTOR, canvas => [].slice.call(canvas.getContext('2d').getImageData(0, 0, 264, 264).data));
const qr = jsQR(qrImgData, 264, 264).data;
+
/**
* Emitted when the QR code is received
* @event Client#qr
@@ -366,7 +366,7 @@ class Client extends EventEmitter {
/**
* Emitted when the client has been disconnected
* @event Client#disconnected
- * @param {WAState} reason state that caused the disconnect
+ * @param {WAState|"NAVIGATION"} reason reason that caused the disconnect
*/
this.emit(Events.DISCONNECTED, state);
this.destroy();
@@ -404,6 +404,13 @@ class Client extends EventEmitter {
* @event Client#ready
*/
this.emit(Events.READY);
+
+ // Disconnect when navigating away
+ // Because WhatsApp Web now reloads when logging out from the device, this also covers that case
+ this.pupPage.on('framenavigated', async () => {
+ this.emit(Events.DISCONNECTED, 'NAVIGATION');
+ await this.destroy();
+ });
}
/**
@@ -893,7 +900,7 @@ module.exports = Client;
diff --git a/docs/ClientInfo.html b/docs/ClientInfo.html
index 7ea2f7b..534e4a6 100644
--- a/docs/ClientInfo.html
+++ b/docs/ClientInfo.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: ClientInfo
+ whatsapp-web.js 1.12.6 » Class: ClientInfo
@@ -15,7 +15,7 @@
@@ -213,18 +213,15 @@
Returns
- object
-
batteryStatus
+ object
batteryStatus
- number
-
batteryStatus.battery - The current battery percentage
+ number
batteryStatus.battery - The current battery percentage
- boolean
-
batteryStatus.plugged - Indicates if the phone is plugged in (true) or not (false)
+ boolean
batteryStatus.plugged - Indicates if the phone is plugged in (true) or not (false)
@@ -238,7 +235,7 @@
diff --git a/docs/Contact.html b/docs/Contact.html
index f599dd2..fa014c3 100644
--- a/docs/Contact.html
+++ b/docs/Contact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: Contact
+ whatsapp-web.js 1.12.6 » Class: Contact
@@ -15,7 +15,7 @@
@@ -257,7 +257,7 @@
diff --git a/docs/GroupChat.html b/docs/GroupChat.html
index 012cad9..c4e2312 100644
--- a/docs/GroupChat.html
+++ b/docs/GroupChat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: GroupChat
+ whatsapp-web.js 1.12.6 » Class: GroupChat
@@ -15,7 +15,7 @@
@@ -405,8 +405,7 @@
Returns
- Promise containing {status: number}
-
Object with status code indicating if the operation was successful
+ Promise containing {status: number}
Object with status code indicating if the operation was successful
@@ -491,8 +490,7 @@
Returns
- Promise containing string
-
Group's invite code
+ Promise containing string
Group's invite code
@@ -602,8 +600,7 @@
Returns
- Promise containing {status: number}
-
Object with status code indicating if the operation was successful
+ Promise containing {status: number}
Object with status code indicating if the operation was successful
@@ -803,8 +800,7 @@
Returns
- Promise containing boolean
-
Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.
+ Promise containing boolean
Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.
@@ -844,8 +840,7 @@
Returns
- Promise containing boolean
-
Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.
+ Promise containing boolean
Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.
@@ -921,7 +916,7 @@
diff --git a/docs/GroupNotification.html b/docs/GroupNotification.html
index dd0ba45..8dd690b 100644
--- a/docs/GroupNotification.html
+++ b/docs/GroupNotification.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: GroupNotification
+ whatsapp-web.js 1.12.6 » Class: GroupNotification
@@ -15,7 +15,7 @@
@@ -233,7 +233,7 @@
diff --git a/docs/InterfaceController.html b/docs/InterfaceController.html
index bf17f92..cdb51d5 100644
--- a/docs/InterfaceController.html
+++ b/docs/InterfaceController.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: InterfaceController
+ whatsapp-web.js 1.12.6 » Class: InterfaceController
@@ -15,7 +15,7 @@
@@ -263,7 +263,7 @@
diff --git a/docs/Label.html b/docs/Label.html
index 53edb44..836d3a9 100644
--- a/docs/Label.html
+++ b/docs/Label.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: Label
+ whatsapp-web.js 1.12.6 » Class: Label
@@ -15,7 +15,7 @@
@@ -163,7 +163,7 @@
diff --git a/docs/Location.html b/docs/Location.html
index 2100f36..b569081 100644
--- a/docs/Location.html
+++ b/docs/Location.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: Location
+ whatsapp-web.js 1.12.6 » Class: Location
@@ -15,7 +15,7 @@
@@ -149,7 +149,7 @@
diff --git a/docs/Message.html b/docs/Message.html
index a6d8f28..638fa34 100644
--- a/docs/Message.html
+++ b/docs/Message.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: Message
+ whatsapp-web.js 1.12.6 » Class: Message
@@ -15,7 +15,7 @@
@@ -487,7 +487,7 @@
diff --git a/docs/MessageMedia.html b/docs/MessageMedia.html
index 5b998cd..7700e59 100644
--- a/docs/MessageMedia.html
+++ b/docs/MessageMedia.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: MessageMedia
+ whatsapp-web.js 1.12.6 » Class: MessageMedia
@@ -15,7 +15,7 @@
@@ -208,7 +208,7 @@
diff --git a/docs/PrivateChat.html b/docs/PrivateChat.html
index 978ead7..46f7117 100644
--- a/docs/PrivateChat.html
+++ b/docs/PrivateChat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: PrivateChat
+ whatsapp-web.js 1.12.6 » Class: PrivateChat
@@ -15,7 +15,7 @@
@@ -519,7 +519,7 @@
diff --git a/docs/PrivateContact.html b/docs/PrivateContact.html
index 7713742..1634805 100644
--- a/docs/PrivateContact.html
+++ b/docs/PrivateContact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: PrivateContact
+ whatsapp-web.js 1.12.6 » Class: PrivateContact
@@ -15,7 +15,7 @@
@@ -283,7 +283,7 @@
diff --git a/docs/Util.html b/docs/Util.html
index 0abd809..85f3d6e 100644
--- a/docs/Util.html
+++ b/docs/Util.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Class: Util
+ whatsapp-web.js 1.12.6 » Class: Util
@@ -15,7 +15,7 @@
@@ -104,8 +104,7 @@
Returns
- Promise containing MessageMedia
-
media in webp format
+ Promise containing MessageMedia
media in webp format
@@ -143,8 +142,7 @@
Returns
- Promise containing MessageMedia
-
media in webp format
+ Promise containing MessageMedia
media in webp format
@@ -182,8 +180,7 @@
Returns
- Promise containing MessageMedia
-
media in webp format
+ Promise containing MessageMedia
media in webp format
@@ -230,7 +227,7 @@
diff --git a/docs/global.html b/docs/global.html
index 5f07e30..2823cd0 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Globals
+ whatsapp-web.js 1.12.6 » Globals
@@ -15,7 +15,7 @@
@@ -1435,7 +1435,7 @@
diff --git a/docs/index.html b/docs/index.html
index 856326c..e561ca7 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Home
+ whatsapp-web.js 1.12.6 » Home
@@ -15,7 +15,7 @@
@@ -27,7 +27,7 @@
@@ -2366,7 +2366,7 @@ client.initialize();
diff --git a/docs/structures_Base.js.html b/docs/structures_Base.js.html
index 5ab039e..6cc2606 100644
--- a/docs/structures_Base.js.html
+++ b/docs/structures_Base.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/Base.js
+ whatsapp-web.js 1.12.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 16778b7..2bce713 100644
--- a/docs/structures_BusinessContact.js.html
+++ b/docs/structures_BusinessContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/BusinessContact.js
+ whatsapp-web.js 1.12.6 » Source: structures/BusinessContact.js
@@ -15,7 +15,7 @@
@@ -59,7 +59,7 @@ module.exports = BusinessContact;
diff --git a/docs/structures_Chat.js.html b/docs/structures_Chat.js.html
index 56fdc2a..3712fa6 100644
--- a/docs/structures_Chat.js.html
+++ b/docs/structures_Chat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/Chat.js
+ whatsapp-web.js 1.12.6 » Source: structures/Chat.js
@@ -15,7 +15,7 @@
@@ -288,7 +288,7 @@ module.exports = Chat;
diff --git a/docs/structures_ClientInfo.js.html b/docs/structures_ClientInfo.js.html
index f563da1..9c73de3 100644
--- a/docs/structures_ClientInfo.js.html
+++ b/docs/structures_ClientInfo.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/ClientInfo.js
+ whatsapp-web.js 1.12.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 1f570a5..60a2c6d 100644
--- a/docs/structures_Contact.js.html
+++ b/docs/structures_Contact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/Contact.js
+ whatsapp-web.js 1.12.6 » Source: structures/Contact.js
@@ -15,7 +15,7 @@
@@ -219,7 +219,7 @@ module.exports = Contact;
diff --git a/docs/structures_GroupChat.js.html b/docs/structures_GroupChat.js.html
index 4df2a9f..348379a 100644
--- a/docs/structures_GroupChat.js.html
+++ b/docs/structures_GroupChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/GroupChat.js
+ whatsapp-web.js 1.12.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 ff0d1b7..3b579a6 100644
--- a/docs/structures_GroupNotification.js.html
+++ b/docs/structures_GroupNotification.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/GroupNotification.js
+ whatsapp-web.js 1.12.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 69eafb6..cebed9d 100644
--- a/docs/structures_Label.js.html
+++ b/docs/structures_Label.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/Label.js
+ whatsapp-web.js 1.12.6 » Source: structures/Label.js
@@ -15,7 +15,7 @@
@@ -88,7 +88,7 @@ module.exports = Label;
diff --git a/docs/structures_Location.js.html b/docs/structures_Location.js.html
index 4100e77..a02e02c 100644
--- a/docs/structures_Location.js.html
+++ b/docs/structures_Location.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/Location.js
+ whatsapp-web.js 1.12.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 2b3e15a..8af39b8 100644
--- a/docs/structures_Message.js.html
+++ b/docs/structures_Message.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/Message.js
+ whatsapp-web.js 1.12.6 » Source: structures/Message.js
@@ -15,7 +15,7 @@
@@ -386,7 +386,7 @@ module.exports = Message;
diff --git a/docs/structures_MessageMedia.js.html b/docs/structures_MessageMedia.js.html
index 58ed8b2..a935379 100644
--- a/docs/structures_MessageMedia.js.html
+++ b/docs/structures_MessageMedia.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/MessageMedia.js
+ whatsapp-web.js 1.12.6 » Source: structures/MessageMedia.js
@@ -15,7 +15,7 @@
@@ -86,7 +86,7 @@ module.exports = MessageMedia;
diff --git a/docs/structures_PrivateChat.js.html b/docs/structures_PrivateChat.js.html
index 7326f5d..0233830 100644
--- a/docs/structures_PrivateChat.js.html
+++ b/docs/structures_PrivateChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/PrivateChat.js
+ whatsapp-web.js 1.12.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 4cbc1fa..bac6ec0 100644
--- a/docs/structures_PrivateContact.js.html
+++ b/docs/structures_PrivateContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: structures/PrivateContact.js
+ whatsapp-web.js 1.12.6 » Source: structures/PrivateContact.js
@@ -15,7 +15,7 @@
@@ -51,7 +51,7 @@ module.exports = PrivateContact;
diff --git a/docs/util_Constants.js.html b/docs/util_Constants.js.html
index 092e10c..46b1d01 100644
--- a/docs/util_Constants.js.html
+++ b/docs/util_Constants.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: util/Constants.js
+ whatsapp-web.js 1.12.6 » Source: util/Constants.js
@@ -15,7 +15,7 @@
@@ -174,7 +174,7 @@ exports.MessageAck = {
diff --git a/docs/util_InterfaceController.js.html b/docs/util_InterfaceController.js.html
index f40ccdd..c6bca88 100644
--- a/docs/util_InterfaceController.js.html
+++ b/docs/util_InterfaceController.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: util/InterfaceController.js
+ whatsapp-web.js 1.12.6 » Source: util/InterfaceController.js
@@ -15,7 +15,7 @@
@@ -116,7 +116,7 @@ module.exports = InterfaceController;
diff --git a/docs/util_Util.js.html b/docs/util_Util.js.html
index 470ac57..14290b7 100644
--- a/docs/util_Util.js.html
+++ b/docs/util_Util.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.12.5 » Source: util/Util.js
+ whatsapp-web.js 1.12.6 » Source: util/Util.js
@@ -15,7 +15,7 @@
@@ -197,7 +197,7 @@ module.exports = Util;
diff --git a/package.json b/package.json
index 6476579..1ff86ec 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "whatsapp-web.js",
- "version": "1.12.5",
+ "version": "1.12.6",
"description": "Library for interacting with the WhatsApp Web API ",
"main": "./index.js",
"typings": "./index.d.ts",