WorkerLocation: pathname プロパティ

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.

pathnameWorkerLocation オブジェクトのプロパティで、このワーカーの場所のパス名 (pathname) 部分を返します。

文字列です。

js
// https://developer.mozilla.org/ja/docs/Web のページにあるウェブワーカーにて
const result = location.pathname; // '/ja/docs/Web' を返す

仕様書

Specification
HTML
# dom-workerlocation-pathname

ブラウザーの互換性

関連情報