Hacker News new | ask | show | jobs
by Navarr 1860 days ago
Yeah this is very clearly on the ad-blocker.

I think TeeSpring has the right idea - they're checking that GA is loaded, if it is, then do stuff with it, if it's not, then don't.

I don't understand how a website can and should be expected to adapt to a browser plugin changing the APIs they depend on out from underneath them.

3 comments

> I think TeeSpring has the right idea - they're checking that GA is loaded, if it is, then do stuff with it, if it's not, then don't.

I think they could go one step further and may be try...catch (sandbox) all access to third-party services that aren't critical.

User-agents, which browsers are, expectedly do put a lot of control in the hands of the end-users. Such breakages should be factored in and worked around (provided there are enough engineering resources to throw at the problem, of course).

Exactly. A browser's job as the user's agent is to do what the user wants it to do. It's not an ABI. If an end-user's browser is configured to do something you, as a developer, don't want or expect, and that breakage causes the loss of a sale, it's kind of on you: Either take a principled stand about "what browsers should be doing" and accept the lost sale, or try/catch around non-critical code to make your site more robust to the user's configuration choices.
The ad blocker is probably trying to do the right thing for their users, to. Too many websites check that GA is loaded, if it is, then do stuff with it, if it's not, then redirect to a "Please disable your ad-blocker" page.
I think the key point is that the only way to do this right is to have a quirks list and both implementations, and pick the implementation based on that list.
Why does checkout depend on Google APIs?