NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Script Auto-Close Whatsapp reminders // @namespace http://tampermonkey.net/ // @version 0.13 // @description Latest version // @author gleish // @license MIT // @match https://web.whatsapp.com/* // @grant none // ==/UserScript== (function() { 'use strict'; var textbox; var success = false; let intervalFrame = setInterval(() => { textbox = document.querySelectorAll('div[data-tab="10"]')[0]; if(textbox) { clearInterval(intervalFrame); let includes = textbox.textContent.includes('!!'); if(includes) { console.log("closing"); document.querySelector('span[data-icon="send"]').parentElement.click(); if(window.opener) { window.opener.postMessage('closed_successfully', '*'); } setTimeout(() => { window.close(); }, 10000); } } console.log(textbox); }, 2000); // Your code here... })();