Support for referrerPolicy
HarmonT opened this issue · 1 comments
Fetch already supports setting referrerPolicy.
But as you know, Fetch is not always a better API than XHR for AJAX, such as progress updating, etc.
So adding support for referrerPolicy in XHR will be helpful.
So far I can only come up with an ugly workaround to support standalone referrerPolicy for every XHR request ---- just create a tag <meta name="referrer" content="{any referrerPolicy you want}">
, and insert it into DOM before sending an XHR request, then remove this <meta>
to clean up.
But the global Referrer-Policy setting of the page will not be restored as it was after the <meta>
being removed. I tested it on Chrome 87.
We're not adding new features to XMLHttpRequest. FetchObserver
is still something we plan to add to fetch()
to address that shortcoming.