By the end of this tutorial, popup windows should no longer appear.
Ad blockers like AdBlock can’t catch every popup window. This guide is a powerful weapon against newtab and newwindow events.
If you know that 99% of popups are scams, this method will come in handy.
You can download the TamperMonkey extension from the official website: Open TamperMonkey.net
Simply choose your browser version and install it like any other extension, such as AdBlock.
After installation, open TamperMonkey and click “Create a new script”.
Paste the following code — it overrides all window.open calls and blocks them:
(function() { 'use strict'; const script = document.createElement('script'); script.textContent = ` (function() { 'use strict'; const originalOpen = window.open; window.open = function(...args) { console.log('Blocked window.open call:', args); return null; }; Window.prototype.open = function(...args) { console.log('Blocked Window.prototype.open call:', args); return null; }; })(); `; document.documentElement.appendChild(script); script.remove(); })();
This code replaces the window.open function so that it returns null, effectively blocking most scam popups.
After pasting and saving the script, enable it. It will run on all websites and block popup windows.
If a page stays cached, simply refresh it (Ctrl+F5).