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 Nutzung 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 nicht partitioniertes 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 Verwendung der Storage Access API für ein vollständigeren Beispiel.

Spezifikationen

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

Browser-Kompatibilität

Siehe auch