Hacker News new | ask | show | jobs
by raincole 1022 days ago
> Feature detection is too much power for developers

- People on HN.

1 comments

Yes, it is too much power for them. Power which they abuse by fingerprinting us. Browser vendors agree with me: they reduced the power of developers by lying to Javascript when they tried to check link styles.

Do you think otherwise?

A. Test for window.fetch.

B. Check if a link is visited.

Whether these two even remotely fall into the same category is left as an exercise for readers.

A. Provides bits of identifying information.

B. Provides bits of identifying information.

To me it seems they're in the exact same category.

Knowing which key the user pressed? Provides bits of identifying information.

Knowing the user's mouse position? Provides bits of identifying information.

Knowing which subdomain the user is visiting? Provides bits of identifying information.

Reading URL query string? Provides bits of identifying information.

If this is a category, it's a quite big one!

Huh. Now I'm not sure Javascript should be able to do any of those things either. Now that you mentioned it, I remember reading about how sites fingerprint users by timing keystrokes and mouse movements and numberless other things.

Maybe the ultimate conclusion is Javascript should not actually exist at all. The web should be declarative, not executable. Developers tell the browser what they want and the browser does it. If it can't be done that way, it isn't done.

Just like Chrome's Manifest V3 making extensions more declarative and limited. My only problem with it is the fact it cripples uBlock Origin. I actually do want those restrictions applied to 100% of all the other extensions, it's just that uBlock Origin is too important and trusted and should be an exception. Honestly, uBlock Origin should be literally built into the browsers at this point. The only reason we can't have that is the massive conflicts of interest involved: can't trust an advertising company to maintain an adblocker.

Using an Abortcontroller with fetch for example is only recently supported. I like to use it where I can, but I don't want to crash on a slightly older browser. Feature detection is absolutely practically useful.
I have no doubt that it's useful. My point is it enables abuse towards us and that the potential for abuse overrides the utility.

Road to hell is paved with good intentions. When you propose a law, you must also think about the numberless ways it could be abused and misused to cause harm. Same principle applies here. The code shouldn't just fail, it should fail in ways that prevent the developer from even knowing it failed much less why. Simply because that would leak information.