WorkerLocation: toString() メソッド
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
toString()
は WorkerLocation
オブジェクトの文字列化メソッドで、このワーカーの位置のシリアライズされた URL
の入った文字列を返します。これは WorkerLocation.href
と同等のものです。
構文
js
toString()
引数
なし。
返値
なし (undefined
)。
例
js
// https://developer.mozilla.org/ja/docs/Web のページにあるウェブワーカーにて
const result = location.toString(); // 'https://developer.mozilla.org/ja/docs/Web' を返す
ブラウザーの互換性
関連情報
- 所属先の
WorkerLocation