@wppconnect-team/wppconnect 2.0.3-alpha.0 → 2.0.3-alpha.1
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 +3 -3
- package/dist/controllers/browser.d.ts +1 -0
- package/dist/controllers/browser.js +22 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## 2.0.3-alpha.
|
|
1
|
+
## 2.0.3-alpha.1 (2026-05-14)
|
|
2
2
|
|
|
3
|
-
###
|
|
3
|
+
### Bug Fixes
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- version to increment it ([38f4e56](https://github.com/wppconnect-team/wppconnect/commit/38f4e567e5ba2f9ec65987581e0441391c8546ff))
|
|
6
6
|
|
|
7
7
|
## 2.0.2 (2026-05-04)
|
|
8
8
|
|
|
@@ -4,6 +4,7 @@ import { Logger } from 'winston';
|
|
|
4
4
|
import { SessionToken } from '../token-store';
|
|
5
5
|
import { LoadingScreenCallback } from '../api/model';
|
|
6
6
|
import { LogLevel } from '../utils/logger';
|
|
7
|
+
export declare function unregisterServiceWorker(page: Page): Promise<void>;
|
|
7
8
|
/**
|
|
8
9
|
* Força o carregamento de uma versão específica do WhatsApp WEB
|
|
9
10
|
* @param page Página a ser injetada
|
|
@@ -52,6 +52,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
52
52
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
+
exports.unregisterServiceWorker = unregisterServiceWorker;
|
|
55
56
|
exports.setWhatsappVersion = setWhatsappVersion;
|
|
56
57
|
exports.initWhatsapp = initWhatsapp;
|
|
57
58
|
exports.onLoadingScreen = onLoadingScreen;
|
|
@@ -69,6 +70,26 @@ const puppeteer_config_1 = require("../config/puppeteer.config");
|
|
|
69
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");
|
|
73
|
+
async function unregisterServiceWorker(page) {
|
|
74
|
+
await page.evaluateOnNewDocument(() => {
|
|
75
|
+
// Remove existent service worker
|
|
76
|
+
navigator.serviceWorker
|
|
77
|
+
.getRegistrations()
|
|
78
|
+
.then((registrations) => {
|
|
79
|
+
for (let registration of registrations) {
|
|
80
|
+
registration.unregister();
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
.catch((err) => null);
|
|
84
|
+
// Disable service worker registration
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
navigator.serviceWorker.register = new Promise(() => { });
|
|
87
|
+
setInterval(() => {
|
|
88
|
+
window.onerror = console.error;
|
|
89
|
+
window.onunhandledrejection = console.error;
|
|
90
|
+
}, 500);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
72
93
|
/**
|
|
73
94
|
* Força o carregamento de uma versão específica do WhatsApp WEB
|
|
74
95
|
* @param page Página a ser injetada
|
|
@@ -109,6 +130,7 @@ async function initWhatsapp(page, token, clear = true, version, proxy, log) {
|
|
|
109
130
|
});
|
|
110
131
|
}
|
|
111
132
|
await page.setUserAgent(WAuserAgente_1.useragentOverride);
|
|
133
|
+
await unregisterServiceWorker(page);
|
|
112
134
|
if (version) {
|
|
113
135
|
log?.('verbose', `Setting WhatsApp WEB version to ${version}`);
|
|
114
136
|
await setWhatsappVersion(page, version, log);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wppconnect-team/wppconnect",
|
|
3
|
-
"version": "2.0.3-alpha.
|
|
3
|
+
"version": "2.0.3-alpha.1",
|
|
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",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@types/atob": "^2.1.4",
|
|
67
67
|
"@types/mime-types": "^3.0.1",
|
|
68
68
|
"@types/mocha": "^10.0.10",
|
|
69
|
-
"@types/node": "^24.12.
|
|
69
|
+
"@types/node": "^24.12.4",
|
|
70
70
|
"@types/shelljs": "^0.10.0",
|
|
71
71
|
"@types/tmp": "^0.2.6",
|
|
72
72
|
"@types/ws": "^8.18.1",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"commitizen": "^4.3.1",
|
|
75
75
|
"concurrently": "^9.2.1",
|
|
76
76
|
"conventional-changelog-cli": "^5.0.0",
|
|
77
|
-
"eslint": "10.
|
|
77
|
+
"eslint": "10.3.0",
|
|
78
78
|
"eslint-config-prettier": "^10.1.8",
|
|
79
79
|
"@tony.ganchev/eslint-plugin-header": "^3.4.4",
|
|
80
80
|
"eslint-plugin-prettier": "^5.5.5",
|
|
81
|
-
"globals": "^17.
|
|
81
|
+
"globals": "^17.6.0",
|
|
82
82
|
"husky": "^9.1.7",
|
|
83
83
|
"mocha": "^11.7.5",
|
|
84
84
|
"prettier": "^2.8.8",
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
"ts-node": "^10.9.2",
|
|
90
90
|
"typedoc": "^0.28.19",
|
|
91
91
|
"typescript": "^5.9.3",
|
|
92
|
-
"typescript-eslint": "^8.
|
|
92
|
+
"typescript-eslint": "^8.59.3",
|
|
93
93
|
"webpack": "^5.106.2",
|
|
94
94
|
"webpack-cli": "^6.0.1"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@wppconnect/wa-js": "^4.1.0",
|
|
97
|
+
"@wppconnect/wa-js": "^4.1.2-alpha.0",
|
|
98
98
|
"@wppconnect/wa-version": "^1.5.3829",
|
|
99
99
|
"atob": "^2.1.2",
|
|
100
100
|
"axios": "^1.16.0",
|