whatsapp: fix crypto.subtle polyfill for Node 18, bump to v2.0.1

This commit is contained in:
2026-07-19 10:16:37 +01:00
parent 4e428073df
commit dd88363d98
3 changed files with 10 additions and 3 deletions
+2 -2
View File
@@ -314,8 +314,8 @@
},
"folder": "whatsapp",
"files": [
{"path": "connector.json", "sha256": "e6b20b9519e19f13297bc1361b342b74bedf234470dbb43d19b39622cd388a4c", "size": 1163},
{"path": "index.js", "sha256": "38be3cc9a5e9ecf7193f917fc3b90e40aeca9753d98d69f27f8155f5f980b4c0", "size": 21258},
{"path": "connector.json", "sha256": "716452f48594a4d9d960de85c0bd4d4f08c33673c6386959b1ef64afc53a6544", "size": 1163},
{"path": "index.js", "sha256": "1627f115a1bfb5a954abd412dba76c38f7202640258d3cbc08c313c00446a14a", "size": 21668},
{"path": "package.json", "sha256": "b99a9dccfd286b59e8482076129f2e40f7b339eba6c3db2a744887d65bd4964e", "size": 302},
{"path": "icon_sm.png", "sha256": "1128f198b2a07041f2e0c8c330fc998d29c310ec3225f866073b9e921aa59b5f", "size": 74223},
{"path": "icon_lg.png", "sha256": "1128f198b2a07041f2e0c8c330fc998d29c310ec3225f866073b9e921aa59b5f", "size": 74223}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "whatsapp",
"name": "WhatsApp",
"version": "2.0.0",
"version": "2.0.1",
"type": "mcp_local",
"scope": "user",
"launch_command": "node index.js",
+7
View File
@@ -24,6 +24,13 @@
* token — so there is nothing to paste back, only a QR to scan.
*/
// Baileys uses the Web Crypto global (`crypto.subtle`), which Node only exposes as
// `globalThis.crypto` from v20+. The container ships Node 18 (Debian bookworm), so
// polyfill it from `node:crypto` — without this, the socket dies on connect with
// "crypto is not defined" and never reaches the QR.
const nodeCrypto = require('crypto');
if (!globalThis.crypto) globalThis.crypto = nodeCrypto.webcrypto;
const fs = require('fs');
const path = require('path');
const readline = require('readline');