mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-23 13:58:09 -05:00
For loading new ads, use visibilitychange event if supported (it generally is). This means that, in theory, a new ad should load in one of the following cases: 1. Active tab changes. 2. Browser is minimized then maximized. 3. Browser window is covered up then uncovered. 4. OS goes to sleep/is locked then woken up/unlocked. This makes a lot more sense than the current trigger, which is just focus. Unfortunately support for cases 2-4 is spotty, but almost all browsers support case 1.