admin管理员组文章数量:1316030
I am using React and I am getting the document referrer using
document.referrer
However when I am directed to my url from google, I am just getting the domain in document.referrer instead of something like this: ;rlz=1C1CHBF_enIN850IN850&oq=fb&aqs=chrome.0.69i59j46i199i291i433j0i131i433l2j0i395j69i60l3.1007j1j9&sourceid=chrome&ie=UTF-8
.
Is there someway I can get the entire URL including pathname and query string? Thanks in advance.
I am using React and I am getting the document referrer using
document.referrer
However when I am directed to my url from google., I am just getting the domain in document.referrer instead of something like this: https://www.google./search?q=fb&rlz=1C1CHBF_enIN850IN850&oq=fb&aqs=chrome.0.69i59j46i199i291i433j0i131i433l2j0i395j69i60l3.1007j1j9&sourceid=chrome&ie=UTF-8
.
Is there someway I can get the entire URL including pathname and query string? Thanks in advance.
Share Improve this question edited Dec 17, 2020 at 8:55 Álvaro González 147k45 gold badges278 silver badges376 bronze badges asked Dec 17, 2020 at 8:43 BhushanBhushan 5056 silver badges11 bronze badges1 Answer
Reset to default 9Websites can set a Referrer-Policy. If they don't then, as of version 85, Chrome defaults to strict-origin-when-cross-origin
. (Other browsers will have their own defaults, but Chrome's marketshare makes it worth highlighting)
This means that the referrer information will include only the origin and not the full URL.
This is a feature designed to protect the user's privacy.
There is no way around it unless you control the site that controls the link (in your example: www.google.
).
本文标签: javascriptHow to get exactly url from documentreferrerStack Overflow
版权声明:本文标题:javascript - How to get exactly url from document.referrer? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741993730a2409623.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论