No focus APIs are necessary to implement pop-unders.
AFAIU, the way modern implementations work, is that they make some link (occasionally the entire body) a target=_blank link, which points to some other part of the website. This causes the link target to appear in a new tab. Now, the original tab has its contents changed to that of an ad; when the user finishes browsing the website and closes the newly-opened tab, they will see the "pop-under" tab (which is actually the original tab the user entered the website with).
Wouldn't this be noticeable in the form of a new tab opening? For example TripAdvisor does pop unders which are unnoticeable until you realize that there is a window (Not a tab even though my settings say to open links in New tabs, never windows) underneath your current window
Unfortunately, preventing those events from running code could be easily programmed around, if, as I assume you mean, you let the rest of javascript run as normal. If you're trying to run code in response to someone clicking on link A but the browser had disabled onclick for link A, you could still register an onclick for the entire page and in that listener examine the coordinates of the mouse to see if it's over link A and then run code "in response" to the click. This is just one of countless ways you could get around the rule I'm sure.
Maybe the browser itself should have more efficient anti-clickjacking tech, such as blacklists and spam classifiers. Users should be able to block all popups from a specific site when protection doesn't work well automatically.
AFAIU, the way modern implementations work, is that they make some link (occasionally the entire body) a target=_blank link, which points to some other part of the website. This causes the link target to appear in a new tab. Now, the original tab has its contents changed to that of an ad; when the user finishes browsing the website and closes the newly-opened tab, they will see the "pop-under" tab (which is actually the original tab the user entered the website with).