WorkerLocation: origin プロパティ

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.

originWorkerLocation オブジェクトのプロパティで、このワーカーのオリジン (origin) を返します。

文字列です。

js
// On this page, returns the origin
const result = self.location.origin; // 'https://developer.mozilla.org:443' を返す

仕様書

Specification
HTML
# dom-workerlocation-origin

ブラウザーの互換性

BCD tables only load in the browser

関連情報