Skip to content

Commit 80fd2ef

Browse files
committed
fix characters like &, +, =, on message using encodeURIComponent
1 parent ef8c28d commit 80fd2ef

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
},
88
"name": "wbm",
99
"description": "wbm is an API to send bulk messages in whatsapp.",
10-
"version": "1.1.10",
10+
"version": "1.1.11",
1111
"main": "src/index.js",
12+
"publishConfig": {
13+
"registry": "https://npm.pkg.github.com/"
14+
},
1215
"devDependencies": {},
1316
"repository": {
1417
"type": "git",

src/api.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ async function start({ showBrowser = false, qrCodeData = false, session = true }
2121
const args = {
2222
headless: !showBrowser,
2323
userDataDir: tmpPath,
24-
args: ["--no-sandbox"]
24+
args: ["--no-sandbox",
25+
// "--blink-settings=imagesEnabled=false"]
26+
]
2527
}
2628
try {
2729
browser = await puppeteer.launch(args);
@@ -146,7 +148,7 @@ async function sendTo(phoneOrContact, message) {
146148
}
147149
try {
148150
process.stdout.write("Sending Message...\r");
149-
await page.goto(`https://web.whatsapp.com/send?phone=${phone}&text=${encodeURI(message)}`);
151+
await page.goto(`https://web.whatsapp.com/send?phone=${phone}&text=${encodeURIComponent(message)}`);
150152
await page.waitForSelector("div#startup", { hidden: true, timeout: 60000 });
151153
await page.waitForSelector('div[data-tab="1"]', { timeout: 5000 });
152154

0 commit comments

Comments
 (0)