referrerPolicy 只读特性在 Request interface returns the referrer policy, which governs what referrer information, sent in the Referer header, should be included with the request.

句法

var myReferrerPolicy = request.referrerPolicy;
					

A DOMString representing the request's referrerPolicy . For more information and possible values, see the Referrer-Policy HTTP header page.

范例

In the following snippet, we create a new request using the Request.Request() constructor (for an image file in the same directory as the script), then save the request referrer policy in a variable:

var myRequest = new Request('flowers.jpg');
var myReferrer = myRequest.referrerPolicy; // returns "" by default
					

规范

规范 状态 注释
Fetch
The definition of 'referrerPolicy' in that specification.
实时标准 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
referrerPolicy Chrome 52 Edge 14 Firefox 52 IE No Opera 39 Safari 11.1 WebView Android 52 Chrome Android 52 Firefox Android 52 Opera Android 41 Safari iOS No Samsung Internet Android 7.2

图例

完整支持

完整支持

不支持

不支持

另请参阅

元数据

  • 最后修改: