Skip to content

Configurable popup blocker that blocks all popup windows by default with a permission model.

License

Notifications You must be signed in to change notification settings

Eskander/ultra-popup-blocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Oct 25, 2024
08eeb86 · Oct 25, 2024
Oct 21, 2024
Oct 25, 2024
Oct 25, 2024
Feb 16, 2021
Jul 15, 2019
Oct 25, 2024
Oct 22, 2024
Oct 22, 2024

Repository files navigation

Ultra Popup Blocker

Ultra Popup Blocker (or UPB for short) is a lightweight Popup Blocker that aims to block all popup windows by default (even good, unharmful, user-initiated ones) unless permission is granted, while providing a clean Permission manager for configuration.

Note

Project in maintenance mode, no new features are planned.

JavaScript Style Guide

Why another popup blocker?

Built-in Firefox and Chrome popup blockers block popups that are created automatically (via scripts, on page load, etc...), while popups linked to user actions are allowed. However, some annoying websites will abuse this to spam you with popups anywhere you click in their pages, even seemingly blank places.

How does it work?

In JavaScript, functions are first-order citizens. It means you can store a function in a variable and pass it freely. You can also modify the native functions provided by the browser, like 'window.open'. Here, we override 'window.open' with our own implementation which prompts the user to see whether they really want to open a popup window. Note that this is not a bullet proof solution. If you want a comprehensive blocker, use uBlock Origin with the right lists.

Managing permissions

The permission manager included with Ultra Popup Blocker lists which websites you trusted to open popups freely.

Install instructions

  1. Get a userscript manager from your browser's addon store:
  2. Add Ultra Popup Blocker from one of the following sources:

GreasyFork OpenUserJS GitHub