whatsapp-web.js 1.23.1-alpha.4 → 1.23.1-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/Client.js +14 -0
package/index.d.ts
CHANGED
|
@@ -1444,7 +1444,7 @@ declare namespace WAWebJS {
|
|
|
1444
1444
|
message: string;
|
|
1445
1445
|
isInviteV4Sent: boolean,
|
|
1446
1446
|
}
|
|
1447
|
-
}
|
|
1447
|
+
}
|
|
1448
1448
|
|
|
1449
1449
|
/** An object that handles options for adding participants */
|
|
1450
1450
|
export interface AddParticipantsOptions {
|
|
@@ -1468,7 +1468,7 @@ declare namespace WAWebJS {
|
|
|
1468
1468
|
* @default ''
|
|
1469
1469
|
*/
|
|
1470
1470
|
comment?: string
|
|
1471
|
-
}
|
|
1471
|
+
}
|
|
1472
1472
|
|
|
1473
1473
|
/** An object that handles the information about the group membership request */
|
|
1474
1474
|
export interface GroupMembershipRequest {
|
package/package.json
CHANGED
package/src/Client.js
CHANGED
|
@@ -105,6 +105,8 @@ class Client extends EventEmitter {
|
|
|
105
105
|
if(!browserArgs.find(arg => arg.includes('--user-agent'))) {
|
|
106
106
|
browserArgs.push(`--user-agent=${this.options.userAgent}`);
|
|
107
107
|
}
|
|
108
|
+
// navigator.webdriver fix
|
|
109
|
+
browserArgs.push('--disable-blink-features=AutomationControlled');
|
|
108
110
|
|
|
109
111
|
browser = await puppeteer.launch({...puppeteerOpts, args: browserArgs});
|
|
110
112
|
page = (await browser.pages())[0];
|
|
@@ -123,6 +125,18 @@ class Client extends EventEmitter {
|
|
|
123
125
|
await this.authStrategy.afterBrowserInitialized();
|
|
124
126
|
await this.initWebVersionCache();
|
|
125
127
|
|
|
128
|
+
// ocVesion (isOfficialClient patch)
|
|
129
|
+
await page.evaluateOnNewDocument(() => {
|
|
130
|
+
const originalError = Error;
|
|
131
|
+
//eslint-disable-next-line no-global-assign
|
|
132
|
+
Error = function (message) {
|
|
133
|
+
const error = new originalError(message);
|
|
134
|
+
const originalStack = error.stack;
|
|
135
|
+
if (error.stack.includes('moduleRaid')) error.stack = originalStack + '\n at https://web.whatsapp.com/vendors~lazy_loaded_low_priority_components.05e98054dbd60f980427.js:2:44';
|
|
136
|
+
return error;
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
|
|
126
140
|
await page.goto(WhatsWebURL, {
|
|
127
141
|
waitUntil: 'load',
|
|
128
142
|
timeout: 0,
|