How about extension with some kind of machine learning? You know, all 4 borders and all 4 corners going dark w/o user interaction. At the same time some kind of form input appear at highest z-index.
Extension would delete that DOM subtree rightaway. + some kind of cloud harvest from users reporting false-positives.
Sure, but how do you do that in a way that can't be circumvented? Alice creates a page with a newsletter popup, then Bob installs a plugin with a MutationObserver [0], so Alice just adds some code to disable any such MutationObservers.
Plus how do you determine when it's an unwanted modal? You don't want to block the login popup, for example. Maybe you can block all modals except for the ones generated from a "click" event, but what if the site sets a "click" listener on the <body> tag?
Extension would delete that DOM subtree rightaway. + some kind of cloud harvest from users reporting false-positives.