HTMLLinkElement.referrerPolicy
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.
io error: No such file or directory (os error 2) (/home/runner/work/yari/yari/mdn/translated-content/files/zh-cn/web/api/htmllinkelement/index.md)
HTMLLinkElement.referrerPolicy
反映了 <link>
元素的 HTML 属性 referrerpolicy
,这个属性定义了 <link>
元素在获取资源时的引用方式。
详情请参考 HTTP 标头 Referrer-Policy
。
示例
js
const links = document.getElementsByTagName("link");
links[0].referrerPolicy; // "no-referrer"
规范
Specification |
---|
HTML Standard # dom-link-referrerpolicy |
浏览器兼容性
BCD tables only load in the browser