StorageAccessHandle: SharedWorker() Methode

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Hinweis: Siehe SharedWorker(), um die Verwendung zu verstehen.

Syntax

js
SharedWorker(aURL)
SharedWorker(aURL, name)
SharedWorker(aURL, options)

Parameter

aURL

Siehe SharedWorker().

name Optional

Siehe SharedWorker().

options Optional

Siehe SharedWorker().

Hinweis: options.sameSiteCookies unterstützt nur den Wert "none", welcher der Standardwert ist.

Rückgabewert

Ein unpartitioniertes SharedWorker Objekt.

Ausnahmen

SecurityError DomException

Wird ausgelöst, wenn der Zugriff nicht gewährt wurde.

Siehe SharedWorker()

Beispiele

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

Hinweis: Siehe Verwenden der Storage Access API für ein vollständigeres Beispiel.

Spezifikationen

Specification
Extending Storage Access API (SAA) to non-cookie storage
# ref-for-dom-storageaccesshandle-sharedworker

Browser-Kompatibilität

BCD tables only load in the browser

Siehe auch