Useful for start a new chat in WhatsApp Web inputing a phone number.
// ==UserScript==
// @name Start new chat direct phone number
// @namespace tools
// @version 0.1
// @description Start a new chat directly inputing the number
// @author user
// @match https://web.whatsapp.com/
// @icon https://www.google.com/s2/favicons?sz=64&domain=whatsapp.com
// @grant none
// @run-at context-menu
// ==/UserScript==
(function() {
'use strict';
let phone = prompt("Phone number:");
if (!phone) {
return
}
const link = document.createElement("a");
link.setAttribute("href", `whatsapp://send?phone=${phone}`);
document.body.append(link);
link.click();
document.body.removeChild(link);
})();