Live data from Hacker News

A JavaScript browser library fails due to an adblocker blacklisting 'beacon.js'

github.com

11–20 of 85 posts

Re: A JavaScript browser library fails due to an adblocker blacklisting 'beacon.js'

#11

An interesting related anecdote on this is that at least in Chrome, adblockers can also interfere with extensions' attempts to load scripts, load stylesheets, or open windows. I maintain an extension with a smallish active userbase (~20k people) and a couple different times I've encountered mysterious failures that were the result of clumsy keyword blocklists in ublock/adblock/etc - for example an extension asset (pa…

If extensions can interfere with each other's internal resources then the real breakage is in the browser's extension mechanism.

Re: A JavaScript browser library fails due to an adblocker blacklisting 'beacon.js'

#12
post #7

Another protip: don't name your images "banner.jpg"; "ads.js" and "analytics.js" etc are also not exactly great names. Another protip: Always make sure that critical flows in the app won't fail if analytics event fails. You probably want to wrap calls to analytics provider with your own function, and in that function check for existence of global analytics object like "window.ga" which may fail to load due to adblock…

Yup, had an "analytics.js" in a project recently (related to an app dashboard, nothing to do with tracking) and it got blocked. Luckily I caught it right away because I have uBlock installed in the same browser I do development in.

Moral of the story: blocklists are a bit shitty and prone to overblocking due to excessively generic rules. Take that into consideration when naming things.

Re: A JavaScript browser library fails due to an adblocker blacklisting 'beacon.js'

#13
Had similar issues while debugging why the advertisement team had trouble deploying their updates using our CI system. Took a really long time to discover the xhr requests for their projects where blocked by the ad-blockers, the irony :)

Re: A JavaScript browser library fails due to an adblocker blacklisting 'beacon.js'

#15
post #3

An interesting related anecdote on this is that at least in Chrome, adblockers can also interfere with extensions' attempts to load scripts, load stylesheets, or open windows. I maintain an extension with a smallish active userbase (~20k people) and a couple different times I've encountered mysterious failures that were the result of clumsy keyword blocklists in ublock/adblock/etc - for example an extension asset (pa…

Shouldn't adblockers whitelist local request to prevent something like this?

Why whitelist, when its easier to rename a file?

Re: A JavaScript browser library fails due to an adblocker blacklisting 'beacon.js'

#16
Here's @vsund, author of this commit message. I understand that the title may was a bit clickbaity and now the title got renamed to a more rational one (which is totally ok).

Unfortunately the new title "A JavaScript browser library fails due to an adblocker blacklisting 'beacon.js'" doesn't reflect the situation very well in my opinion. The library didn't fail (mainly because there is no library yet), what instead happened is that the adblocker blocked GitHub internal requests which resulted in a unusable repository. The adblocker blocks requests that simply has "beacon.js" anywhere in the URL.

I see this rather as an issue of adblockers blocking to much than bad naming of projects :)

Re: A JavaScript browser library fails due to an adblocker blacklisting 'beacon.js'

#17
post #7

Another protip: don't name your images "banner.jpg"; "ads.js" and "analytics.js" etc are also not exactly great names. Another protip: Always make sure that critical flows in the app won't fail if analytics event fails. You probably want to wrap calls to analytics provider with your own function, and in that function check for existence of global analytics object like "window.ga" which may fail to load due to adblock…

> Another protip: don't name your images "banner.jpg"; "ads.js" and "analytics.js" etc are also not exactly great names.

This is good advice even if you are designing banner ads or intrusive analytics!

I often wondered how many ads get blocked by the very simple rules usually seen at the top of adblock lists: /ads/ etc. Ads vs adblockers is an arms race, and it seems like renaming the ads files to a random per-deployment name would have been the first escalation by the "bad guys". But maybe many developers of ad software don't even bother to fight adblock, preferring to optimize for users who don't use one.

Re: A JavaScript browser library fails due to an adblocker blacklisting 'beacon.js'

#18
One time I came across a github user with a username that started with a hyphen. I could browse their repos fine, but I couldn't view their github.io site on Linux.

It turns out that Windows and OSX allow domain components to start with a hyphen, but Linux does not. There is at least one DNS RFC that disallows this though.

Relevant Ubuntu bug. https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/66...

Re: A JavaScript browser library fails due to an adblocker blacklisting 'beacon.js'

#19
post #12
post #7

Another protip: don't name your images "banner.jpg"; "ads.js" and "analytics.js" etc are also not exactly great names. Another protip: Always make sure that critical flows in the app won't fail if analytics event fails. You probably want to wrap calls to analytics provider with your own function, and in that function check for existence of global analytics object like "window.ga" which may fail to load due to adblock…

Yup, had an "analytics.js" in a project recently (related to an app dashboard, nothing to do with tracking) and it got blocked. Luckily I caught it right away because I have uBlock installed in the same browser I do development in. Moral of the story: blocklists are a bit shitty and prone to overblocking due to excessively generic rules. Take that into consideration when naming things.

[deleted]

Re: A JavaScript browser library fails due to an adblocker blacklisting 'beacon.js'

#20
post #3

An interesting related anecdote on this is that at least in Chrome, adblockers can also interfere with extensions' attempts to load scripts, load stylesheets, or open windows. I maintain an extension with a smallish active userbase (~20k people) and a couple different times I've encountered mysterious failures that were the result of clumsy keyword blocklists in ublock/adblock/etc - for example an extension asset (pa…

Shouldn't adblockers whitelist local request to prevent something like this?

Also the filter in question "/beacon.js" is 3 years old in Easyprivacy, to be exact "Feb 23, 2014". I could understand if it was a recent commit but its not, the onus shouldn't be on the List authors to fix it, but the site owner (yourself) to fix it.
Post reply on HN