browser
browser copied to clipboard
Feature request: detect browser prefetch
It would be nice to have browser.prefetch? that detects if the request is coming from a Omnibar prefetch that modern browsers perform.
This stackoverflow answer (https://stackoverflow.com/questions/9852257/http-header-to-detect-a-preload-request-by-google-chrome) tells that each browser vendor sends different headers, being:
- Chrome:
Purpose: prefetch - Firefox:
X-moz: prefetch - Safari:
X-Purpose: preview
That'd be very helpful.
As I've dig into this subject I will let here some useful documentation I've found about the issue, in case it can help anyone else:
- https://stackoverflow.com/a/2030947 (Safari and Facebook Preview)
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ#as_a_server_admin.2c_can_i_distinguish_prefetch_requests_from_normal_requests.3f