![]() ![]() Maybe it's over the top or paranoid but it covers for ad blocking systems that block only one or two out of the selection and therefore may not have been covered had you only done the one check. After looking here and elsewhere I surmised that the main three client side checks for indirectly detecting an ad blocker were to check for blocked div/ img, blocked iframes and blocked resources (javascript files). Checking the type of variable after a certain time can tell you if the script was loaded.ĭespite the age of this question, I recently found it very useful and therefore can only assume there are others still viewing it. Update uBlock Origin loads their own ads-prebid.js that reverts the trick described in this answer (proud!), their file contains the following: (function() when it executes. Update Call this variable something else, see below! var canRunAds = true ![]() This is the only line of code in that file. I added a small js file to my webroot with the name prebid-ads.js AdBlock blocks all URLs containing the word "ads" or "prebid". I've been running it in production for a few years. My solution is not specific to a certain ad network and is very lightweight. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |