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. |
实时标准 | 初始定义 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 |
完整支持
不支持