Request: referrerPolicy プロパティ

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.

メモ: この機能はウェブワーカー内で利用可能です。

referrerPolicyRequest インターフェイスの読み取り専用プロパティで、Referer ヘッダーで送信されるどのリファラー情報がリクエストに記載されるべきかを管理する、リファラーポリシーを返します。

このリクエストの referrerPolicy を表す文字列です。詳細な情報や使用可能な値については、 HTTP の Referrer-Policy ヘッダーのページを参照してください。

次のスニペットでは、 Request.Request() コンストラクターを使って(スクリプトと同じディレクトリーにある画像ファイルのための)新しいリクエストを生成してから、変数にリクエストのリファラーポリシーを保存しています。

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

仕様書

Specification
Fetch
# ref-for-dom-request-referrerpolicy②

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
referrerPolicy

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報