4 ms·
What is the intended use case for this feature?
by ToFab123 8y ago
What is the intended use case for this feature?
- lozenge 8y agoIt's for sites like Google who want to know which search result you click on. Previously, this involved adding an on click handler to the link. The JavaScript in the handler then delayed the navigation to the next page, as unloading the page would stop the JS&the ping request would not get sent. With this feature, the browser could immediately navigate to the link target and simultaneously make the ping request in the background.
- unilynx 8y agothat's already solved with navigator.sendBeacon - no need to stop unloading the page to make sure the ping gets through
- tyingq 8y agoWhatWG says it exists because it's more performant and transparent to end users than js or redirect based tracking. It also says the end user can disable it. Guess that bit is being dropped?: "The ping attribute is redundant with pre-existing technologies like HTTP redirects and JavaScript in allowing Web pages to track which off-site links are most popular or allowing advertisers to track click-through rates. However, the ping attribute provides these advantages to the user over those alternatives: It allows the user to see the final target URL unobscured. It allows the UA to inform the user about the out-of-band notifications. It allows the user to disable the notifications without losing the underlying link functionality. It allows the UA to optimize the use of available network bandwidth so that the target page loads faster. Thus, while it is possible to track users without this feature, authors are encouraged to use the ping attribute so that the user agent can make the user experience more transparent." https://html.spec.whatwg.org/multipage/links.html#hyperlink-auditing https://html.spec.whatwg.org/multipage/links.html#hyperlink-...
- deleted 8y ago[deleted]