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.17
// @description Latest version
// @author gleish
// @license MIT
// @match https://web.whatsapp.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
setTimeout(() => {
window.close();
}, 1000 * 60 * 3);
let intervalFrame = setInterval(() => {
const textbox = Array.from(document.querySelectorAll('div[data-tab="10"]')).pop();
if (textbox) {
clearInterval(intervalFrame);
// Espera breve antes de intentar enviar
setTimeout(() => {
const sendButton = document.querySelector('button[data-testid="send"]') ||
document.querySelector('[data-icon="wds-ic-send-filled"]')?.parentElement ||
document.querySelector('span[data-icon="send"]')?.parentElement;
if (sendButton) {
console.log("Enviando mensaje...");
sendButton.click();
setTimeout(() => window.close(), 10000);
} else {
console.log("No se encontró el botón de enviar.");
}
}, 1000);
} else {
console.log("Esperando textbox...");
}
}, 2000);
})();