Hacker News new | ask | show | jobs
by cozuya 4190 days ago
Effectively you're asking for all document.createElement calls to be blocked. Those are used for all sorts of things that aren't ads or popups. Blocking that would probably cause a very large percent of pages to be completely broken.
1 comments

So there's no explicit way to distinguish between "new window" calls from other types of calls? I'm kind of shocked that, with all the effort that's been put into browsers in recent years, that the ability to "create a new window" hasn't been removed entirely from the API without explicit user consent. Again, I can't think of a single site that uses this feature legitimately.
If you're talking about actual new windows that are a separate process, those have been blocked by popup blockers for years. As far as popovers that block the screen/annoy you, those are just HTML elements that are positioned on top of normal content - its not a "special" thing backed into the DOM API. There's really no effective way to stop a page from being able to do that unless you disable javascript entirely.
There have been tricks that get popups through, possibly by exploiting browser bugs or opening the popup in one of the few on* handlers where browsers allow them.
I use strict pop up blocker on firefox which works great. There's a toggle button in case a site doesn't work properly.

https://addons.mozilla.org/en-US/firefox/addon/strict-pop-up...