@wppconnect-team/wppconnect 2.0.3-alpha.2 → 2.1.0
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/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# 2.1.0 (2026-05-15)
|
|
2
2
|
|
|
3
|
-
###
|
|
4
|
-
|
|
5
|
-
- more attempts from wa-js ([3c5d70d](https://github.com/wppconnect-team/wppconnect/commit/3c5d70d54aec76e011875ed3a86e7ce50e02c863))
|
|
6
|
-
|
|
7
|
-
## 2.0.3-alpha.1 (2026-05-14)
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
3
|
+
### Features
|
|
10
4
|
|
|
11
|
-
- version to
|
|
5
|
+
- bump @wppconnect/wa-js to ^4.2.0 and @wppconnect/wa-version to ^1.5.3941 ([#2779](https://github.com/wppconnect-team/wppconnect/issues/2779)) ([3ec91eb](https://github.com/wppconnect-team/wppconnect/commit/3ec91eb11cda9cf3743307f17bb20366ba710301))
|
|
12
6
|
|
|
13
7
|
## 2.0.2 (2026-05-04)
|
|
14
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Browser, BrowserContext, Page } from 'puppeteer';
|
|
2
|
-
import { Logger } from 'winston';
|
|
3
|
-
import { LoadingScreenCallback } from '../api/model';
|
|
4
2
|
import { CreateConfig } from '../config/create-config';
|
|
3
|
+
import { Logger } from 'winston';
|
|
5
4
|
import { SessionToken } from '../token-store';
|
|
5
|
+
import { LoadingScreenCallback } from '../api/model';
|
|
6
6
|
import { LogLevel } from '../utils/logger';
|
|
7
7
|
export declare function unregisterServiceWorker(page: Page): Promise<void>;
|
|
8
8
|
/**
|
|
@@ -59,14 +59,15 @@ exports.onLoadingScreen = onLoadingScreen;
|
|
|
59
59
|
exports.injectApi = injectApi;
|
|
60
60
|
exports.initBrowser = initBrowser;
|
|
61
61
|
exports.getOrCreatePage = getOrCreatePage;
|
|
62
|
-
const waVersion = __importStar(require("@wppconnect/wa-version"));
|
|
63
|
-
const axios_1 = __importDefault(require("axios"));
|
|
64
62
|
const ChromeLauncher = __importStar(require("chrome-launcher"));
|
|
65
63
|
const os = __importStar(require("os"));
|
|
66
64
|
const path = __importStar(require("path"));
|
|
67
|
-
const puppeteer_1 = __importDefault(require("puppeteer"));
|
|
68
65
|
const rimraf = __importStar(require("rimraf"));
|
|
66
|
+
const waVersion = __importStar(require("@wppconnect/wa-version"));
|
|
67
|
+
const axios_1 = __importDefault(require("axios"));
|
|
68
|
+
const puppeteer_extra_1 = __importDefault(require("puppeteer-extra"));
|
|
69
69
|
const puppeteer_config_1 = require("../config/puppeteer.config");
|
|
70
|
+
const puppeteer_extra_plugin_stealth_1 = __importDefault(require("puppeteer-extra-plugin-stealth"));
|
|
70
71
|
const WAuserAgente_1 = require("../config/WAuserAgente");
|
|
71
72
|
const websocket_1 = require("./websocket");
|
|
72
73
|
async function unregisterServiceWorker(page) {
|
|
@@ -180,22 +181,22 @@ async function onLoadingScreen(page, onLoadingScreenCallBack) {
|
|
|
180
181
|
let progressMessage = window2.getElementByXpath(selectors.PROGRESS_MESSAGE);
|
|
181
182
|
let progressMessageNewTheme = window2.getElementByXpath(selectors.PROGRESS_MESSAGE_NEW_THEME);
|
|
182
183
|
if (progressBar) {
|
|
183
|
-
if (lastPercent !== progressBar.value ||
|
|
184
|
-
lastPercentMessage !== progressMessage.innerText) {
|
|
184
|
+
if (this.lastPercent !== progressBar.value ||
|
|
185
|
+
this.lastPercentMessage !== progressMessage.innerText) {
|
|
185
186
|
window2.loadingScreen(progressBar.value, progressMessage.innerText);
|
|
186
|
-
lastPercent = progressBar.value;
|
|
187
|
-
lastPercentMessage = progressMessage.innerText;
|
|
187
|
+
this.lastPercent = progressBar.value;
|
|
188
|
+
this.lastPercentMessage = progressMessage.innerText;
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
191
|
else if (progressBarNewTheme) {
|
|
191
|
-
if (lastPercent !== progressBarNewTheme.value ||
|
|
192
|
-
lastPercentMessage !== progressMessageNewTheme.innerText) {
|
|
192
|
+
if (this.lastPercent !== progressBarNewTheme.value ||
|
|
193
|
+
this.lastPercentMessage !== progressMessageNewTheme.innerText) {
|
|
193
194
|
const progressMsg = progressMessageNewTheme.innerText != 'WhatsApp'
|
|
194
195
|
? progressMessageNewTheme.innerText
|
|
195
196
|
: '';
|
|
196
197
|
window2.loadingScreen(progressBarNewTheme.value, progressMsg);
|
|
197
|
-
lastPercent = progressBarNewTheme.value;
|
|
198
|
-
lastPercentMessage = progressMsg;
|
|
198
|
+
this.lastPercent = progressBarNewTheme.value;
|
|
199
|
+
this.lastPercentMessage = progressMsg;
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
202
|
});
|
|
@@ -263,10 +264,12 @@ async function initBrowser(session, options, logger) {
|
|
|
263
264
|
});
|
|
264
265
|
}
|
|
265
266
|
}
|
|
267
|
+
// Use stealth plugin to avoid being detected as a bot
|
|
268
|
+
puppeteer_extra_1.default.use((0, puppeteer_extra_plugin_stealth_1.default)());
|
|
266
269
|
let browser = null;
|
|
267
270
|
if (options.browserWS && options.browserWS != '') {
|
|
268
271
|
const transport = await getTransport(options.browserWS);
|
|
269
|
-
browser = await
|
|
272
|
+
browser = await puppeteer_extra_1.default.connect({ transport });
|
|
270
273
|
}
|
|
271
274
|
else {
|
|
272
275
|
/**
|
|
@@ -282,7 +285,7 @@ async function initBrowser(session, options, logger) {
|
|
|
282
285
|
if (options.proxy && options.proxy.url) {
|
|
283
286
|
args.push(`--proxy-server=${options.proxy.url}`);
|
|
284
287
|
}
|
|
285
|
-
browser = await
|
|
288
|
+
browser = await puppeteer_extra_1.default.launch({
|
|
286
289
|
headless: options.headless,
|
|
287
290
|
devtools: options.devtools,
|
|
288
291
|
args,
|
|
@@ -292,7 +295,7 @@ async function initBrowser(session, options, logger) {
|
|
|
292
295
|
try {
|
|
293
296
|
const arg = browser
|
|
294
297
|
.process()
|
|
295
|
-
|
|
298
|
+
.spawnargs.find((s) => s.startsWith('--user-data-dir='));
|
|
296
299
|
if (arg) {
|
|
297
300
|
const tmpUserDataDir = arg.split('=')[1];
|
|
298
301
|
// Only if path is in TMP directory
|
|
@@ -204,12 +204,6 @@ async function create(sessionOrOption, catchQR, statusFind, onLoadingScreen, cat
|
|
|
204
204
|
}
|
|
205
205
|
if (page) {
|
|
206
206
|
await page.setBypassCSP(true);
|
|
207
|
-
// Grant persistent-storage permission so WhatsApp Web's IndexedDB is never
|
|
208
|
-
// evicted by Chrome under memory pressure (prevents storage-related disconnections)
|
|
209
|
-
await page
|
|
210
|
-
.browserContext()
|
|
211
|
-
.overridePermissions('https://web.whatsapp.com', ['persistent-storage'])
|
|
212
|
-
.catch(() => null);
|
|
213
207
|
const client = new whatsapp_1.Whatsapp(page, session, mergedOptions);
|
|
214
208
|
client.catchQR = catchQR;
|
|
215
209
|
client.statusFind = statusFind;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wppconnect-team/wppconnect",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination... 😀🤔💭",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -63,12 +63,10 @@
|
|
|
63
63
|
"@commitlint/config-conventional": "^20.5.3",
|
|
64
64
|
"@commitlint/cz-commitlint": "^20.5.3",
|
|
65
65
|
"@eslint/js": "^10.0.1",
|
|
66
|
-
"@tony.ganchev/eslint-plugin-header": "^3.4.4",
|
|
67
66
|
"@types/atob": "^2.1.4",
|
|
68
67
|
"@types/mime-types": "^3.0.1",
|
|
69
68
|
"@types/mocha": "^10.0.10",
|
|
70
69
|
"@types/node": "^24.12.4",
|
|
71
|
-
"@types/rimraf": "^3.0.2",
|
|
72
70
|
"@types/shelljs": "^0.10.0",
|
|
73
71
|
"@types/tmp": "^0.2.6",
|
|
74
72
|
"@types/ws": "^8.18.1",
|
|
@@ -78,6 +76,7 @@
|
|
|
78
76
|
"conventional-changelog-cli": "^5.0.0",
|
|
79
77
|
"eslint": "10.3.0",
|
|
80
78
|
"eslint-config-prettier": "^10.1.8",
|
|
79
|
+
"@tony.ganchev/eslint-plugin-header": "^3.4.4",
|
|
81
80
|
"eslint-plugin-prettier": "^5.5.5",
|
|
82
81
|
"globals": "^17.6.0",
|
|
83
82
|
"husky": "^9.1.7",
|
|
@@ -95,10 +94,10 @@
|
|
|
95
94
|
"webpack-cli": "^6.0.1"
|
|
96
95
|
},
|
|
97
96
|
"dependencies": {
|
|
98
|
-
"@wppconnect/wa-js": "^4.
|
|
99
|
-
"@wppconnect/wa-version": "^1.5.
|
|
97
|
+
"@wppconnect/wa-js": "^4.2.0",
|
|
98
|
+
"@wppconnect/wa-version": "^1.5.3941",
|
|
100
99
|
"atob": "^2.1.2",
|
|
101
|
-
"axios": "^1.16.
|
|
100
|
+
"axios": "^1.16.1",
|
|
102
101
|
"boxen": "^5.1.2",
|
|
103
102
|
"catch-exit": "^2.0.0",
|
|
104
103
|
"chalk": "~4.1.2",
|
|
@@ -110,7 +109,11 @@
|
|
|
110
109
|
"logform": "^2.7.0",
|
|
111
110
|
"lookpath": "^1.2.3",
|
|
112
111
|
"mime-types": "^3.0.2",
|
|
113
|
-
"puppeteer": "^24.
|
|
112
|
+
"puppeteer": "^24.37.5",
|
|
113
|
+
"puppeteer-extra": "^3.3.6",
|
|
114
|
+
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
|
115
|
+
"puppeteer-extra-plugin-user-data-dir": "^2.4.1",
|
|
116
|
+
"puppeteer-extra-plugin-user-preferences": "^2.4.1",
|
|
114
117
|
"qrcode-terminal": "^0.12.0",
|
|
115
118
|
"reflect-metadata": "^0.2.1",
|
|
116
119
|
"rimraf": "^3.0.2",
|