Firefox Tomorrow

web api instance method

StorageAccessHandle: SharedWorker() method

View on MDN ↗

[!NOTE] See SharedWorker() to understand usage.

Syntax

SharedWorker(url)
SharedWorker(url, name)
SharedWorker(url, options)

Parameters

[!NOTE] options.sameSiteCookies only supports the value “none”, which is the default.

Return value

An unpartitioned SharedWorker object.

Exceptions

  • SecurityError DomException
    • : Thrown if access was not granted.

See SharedWorker()

Examples

document.requestStorageAccess({ SharedWorker: true }).then(
  (handle) => {
    console.log("SharedWorker access granted");
    handle.SharedWorker(shared_worker_url);
  },
  () => {
    console.log("SharedWorker access denied");
  },
);

[!NOTE] See Using the Storage Access API for a more complete example.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also