Request: redirect プロパティ

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.

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

redirectRequest インターフェイスの読み取り専用プロパティで、リダイレクトを処理する方法のモードを保持します。

RequestRedirect 列挙値で、以下の文字列のいずれかになります。

  • follow
  • error
  • manual

リクエストの作成時に指定されなかった場合は、既定値の follow になります。

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

js
const myRequest = new Request("flowers.jpg");
const myCred = myRequest.redirect;

仕様書

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

ブラウザーの互換性

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
redirect

Legend

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

Full support
Full support
See implementation notes.

関連項目