Skip to content

Instantly share code, notes, and snippets.

@ibernabel
Created February 9, 2024 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ibernabel/f01540b5f5d9b324f6706af7cdfc4179 to your computer and use it in GitHub Desktop.
Save ibernabel/f01540b5f5d9b324f6706af7cdfc4179 to your computer and use it in GitHub Desktop.
Script to go (select) to the WhatsApp web version when sending an automatic message.
setTimeout(function(){
const url = window.location.href;
if(url.includes("api.whatsapp.com")){
let button = document.querySelector("#action-button");
button.click();
setTimeout(function(){
let link = document.querySelector("#fallback_block > div > div > h4:nth-child(2) > a");
link.click();
},300);
}
},300);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment