TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Tracking Blocked Scripts

49 pointsby Amorymeltzerabout 2 years ago

7 comments

varencabout 2 years ago
Armed with this information I discovered the endpoint codepen hits when it detects that the ad-serving script is blocked!<p><pre><code> https:&#x2F;&#x2F;codepen.io&#x2F;cpe&#x2F;puppies-and-kittens?id=&lt;id&gt; </code></pre> It looked so innocuous it took me a sec to notice. You can definitely tell it&#x27;s named in a way to avoid blocking rules. I appreciate the little humor too.<p>Codepen plays nice and just uses this for logging purposes. But when other sites take more aggressive anti-ad-block measures your ad-blocker can still defeat them by silently redirecting some analytics&#x2F;ad-serving JavaScipt to an internal no-op resource. That way the error handler isn&#x27;t called but the JS doesn&#x27;t actually run. Or the JS is replaced with a no-op equivalent. See uBlock&#x27;s resource library here: <a href="https:&#x2F;&#x2F;github.com&#x2F;gorhill&#x2F;uBlock&#x2F;wiki&#x2F;Resources-Library">https:&#x2F;&#x2F;github.com&#x2F;gorhill&#x2F;uBlock&#x2F;wiki&#x2F;Resources-Library</a><p>(I imagine a site like codepen, with its technical audience, sees a lot more users with ad blockers.)
评论 #35981624 未加载
评论 #35999545 未加载
评论 #35999023 未加载
nr2xabout 2 years ago
“Hey the user clearly doesn’t want this. But I’m a web developer in 2023 and the user is my enemy! How can we do something the user explicitly does not want us to do?”
评论 #35982872 未加载
评论 #35982472 未加载
评论 #35982866 未加载
评论 #35983666 未加载
jccalhounabout 2 years ago
Amusingly, when javascripts are blocked on his site it is a black background with white text which is easier for me to read than the color scheme with javascripts allowed
评论 #35982322 未加载
out-of-ideasabout 2 years ago
hmm - i think the author is confusing all scripts from not being loaded as explicitly blocked.<p>there are other reasons the script may not be loaded and categorizing them as &#x27;blocked&#x27; is not an accurate label. first example would be to curl the main page; and that is certainly NOT blocking the script
LegitShadyabout 2 years ago
the internet is more or less unusable without script and ad blockers. sorry not sorry.
Semaphorabout 2 years ago
What’s the difference between this, and doing an XHR request to the same script with try {} catch {}? That is what we are currently doing. I guess it’s one request fewer if you need the script anyway, is there any other difference?
zagrebianabout 2 years ago
So 28% have ad blockers (or similar blockers).