このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

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 2015年7月.

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' を返す

ブラウザーの互換性

関連情報