3 ms·
They can use onclick and leave the href attribute alone.
by cube00 5y ago
They can use onclick and leave the href attribute alone.
- igravious 5y agoBut what to do about them JavaScript disabling varmints then?
- JimDabell 5y agoThat’s what hyperlink auditing with the ping attribute is for: https://html.spec.whatwg.org/multipage/links.html#hyperlink-auditing https://html.spec.whatwg.org/multipage/links.html#hyperlink-... You put a `ping` attribute on a link, and when the user follows the link, the browser sends a request to the ping URL notifying it of the action. Firefox disables it by default, which doesn’t seem like much of a privacy win considering JavaScript is enabled by default and can polyfill this functionality.
- moshmosh 5y agoGiving Javascript the ability to make requests without asking the user via dialog for each one—if we must allow it at all—was a mistake.
- Closi 5y agoI'm sure this is something they have considered as their own analytics program uses onclick to track outbound traffic - I assume it's a mix of speed, reliability and the ability to track without javascript. Plus, if it was done on OnClick there would definitely be an add-on to disable the tracking on all browsers.
- mobjack 5y agoThere are some privacy reasons for it. A direct link from a search page will let websites see the search terms that users entered in to navigate there. Google still knows everything so it doesn't protect you from them, but websites are more in the dark what users were doing before clicking the link.
- simcop2387 5y agoAnd then Google aggregates that back to sides that use Google analytics so that they get both sides of the users
- niutech 5y agoThere is rel="noreferrer" for that.
- arghwhat 5y agoThen they can't track if you share the link!