Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LucasMetal/438ff2336e417cff5b52 to your computer and use it in GitHub Desktop.
Save LucasMetal/438ff2336e417cff5b52 to your computer and use it in GitHub Desktop.
Greasemonkey script that prevents WhatsApp web from asking for confirmation before closing the page.
// ==UserScript==
// @name WhatsApp Web Unload Handler remover
// @namespace LucasMetal
// @description Prevents WhatsApp web from asking for confirmation before closing the page.
// @include https://web.whatsapp.com/
// @version 1
// @grant none
// @author @LucasMetal
// ==/UserScript==
setTimeout(function(){
window.onbeforeunload = null;
window.onunload = null;
}, 5000); // 5 seconds timeOut is simple and enough;)
@alexisalvarez88
Copy link

Less comments and more lines of code pls :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment