YouTube is running an experiment asking some users to disable their ad blockers or pay for a premium subscription, or they will not be allowed to watch videos.
There are numerous ways to detect ad-blockers. The most robust way is to default to assuming the user has an ad blocker (fail-safe design), loads an ad script, and the ad script continues loading the page (video, article content, etc). If the ad script is blocked, the page will stop loading, and the default adblock state will be rendered.
A more brittle option is to load the ad script with an error handler (or detect if it is blocked via a timing attack) and then the error handler changes the page to reflect the ad script was blocked. The reason this is more brittle is that the user can simply intercept and remove the error handler. (In contrast to the above approach, this is fail-deadly design.)
Some websites load the ads before the page itself, which seems to get around many adblockers. Or at least I’ve heard some folks say that. Can’t say for certain, though my adblocker doesn’t seem to work at all on some sites, and that could be why.
Youtube could bake the ads into the video stream to make them unskippable. This still wouldn’t stop frontend technologies like Invidious from scraping.
There are numerous ways to detect ad-blockers. The most robust way is to default to assuming the user has an ad blocker (fail-safe design), loads an ad script, and the ad script continues loading the page (video, article content, etc). If the ad script is blocked, the page will stop loading, and the default adblock state will be rendered.
A more brittle option is to load the ad script with an error handler (or detect if it is blocked via a timing attack) and then the error handler changes the page to reflect the ad script was blocked. The reason this is more brittle is that the user can simply intercept and remove the error handler. (In contrast to the above approach, this is fail-deadly design.)
Some websites load the ads before the page itself, which seems to get around many adblockers. Or at least I’ve heard some folks say that. Can’t say for certain, though my adblocker doesn’t seem to work at all on some sites, and that could be why.
Youtube could bake the ads into the video stream to make them unskippable. This still wouldn’t stop frontend technologies like Invidious from scraping.