CSS/JS popover ads are almost as bad as popup ads used to be.
Popover ads have three geographic attributes:
- Location - The X/Y location of the top-left corner.
- Size - The screen area that the ad covers.
- Z-Index - The third dimension of the ad. What makes it pop over
Popover ads also have these attributes:
- Content - Popover ads are likely to have less material inside them (smaller paragraphs and less text) than the content which they are popping over.
- Destruction - There is code somewhere to remove or hide a popover ad. The obvious methods are destroying the node, undisplaying it, or removing its z-index.
Identifying potential popovers:
When a browser comes across material with a non-default Z-index, it can ask the questions:
- Does this material have a higher Z-index than other material?
- Is there other material with a higher Z-index than this material?
If so, score it based on these factors:
- Is it covering a significant area of another node?
- Is it covering a significant area of static content?
- Is it covering something with more text than it contains?
- Is it created by a script, or have its borders or z-index been changed by a script?
Handling potential popovers and false positives
- The browser can place a warning icon on the status bar. Clicking the icon will list popovers and allow the user to accept them.
- Popovers can be permanently blocked based on the URL of the script that creates them. Wildcards should be acceptable. Node IDs, line numbers, and even script hashes are too easily changed; I can easily see an ad company fluxing its scripts by changing the variable names every load.
- Potential popovers originating from certain URLs can be whitelisted.
- If a popover is blocked by a blacklist, it should be removed from the DOM tree.
- To block popovers opens the issue that companies seeking ad revenue might change their content to match the heuristics of a popover while making the popover part of the main HTML page.