4 ms·
This shit drives me up a goddamn wall. I had a web app a few years ago that I was using webpack to build the JS with, and the output filename was just a SHA ha
by Klathmon 9y ago
This shit drives me up a goddamn wall.
I had a web app a few years ago that I was using webpack to build the JS with, and the output filename was just a SHA hash of the contents.
After an update, I started getting reports that it wasn't working for some people. Turns out they had adblockers that were blocking *ad.js and it just so happened that the SHA hash of the file ended in ad.js
- Scaevolus 9y agoMedium had the same problem where hash-named paragraph divs would disappear if they contained "ad".
- throwaway2016a 9y agoWow. Thank you for this story. Word that this could happen should get out there. I would have never thought to look for hashes that happen to end in "ad"
- deleted 9y ago[deleted]
- jakub_g 9y agoHmm I wouldn't think of this aspect but it's really insidious! Looks like it could be interesting to submit a PR to some popular hashing libs to have a 'adblock-safe' mode (append some postfix if hash ends with 'ad' etc) or at least document the thing so that more developers are aware!
- OJFord 9y ago> Looks like it could be interesting to submit a PR to some popular hashing libs to have a 'adblock-safe' mode (append some postfix if hash ends with 'ad' etc) Why is that preferable to a PR that fixes the bad regex? I would suggest `[^A-Za-z0-9]ad.js` is better - it's not just hashes that would fall foul of this, any word that happens to end in 'ad' is going to break. If it's actually about ads, the prefix is probably going to be something like 'blah-' or 'main.' or whatever, surely?