web api instance method
StorageAccessHandle: SharedWorker() method
[!NOTE] See
SharedWorker()to understand usage.
Syntax
SharedWorker(url)
SharedWorker(url, name)
SharedWorker(url, options)
Parameters
url- : See
SharedWorker().
- : See
nameOptional- : See
SharedWorker().
- : See
optionsOptional- : See
SharedWorker().
- : See
[!NOTE]
options.sameSiteCookiesonly supports the value “none”, which is the default.
Return value
An unpartitioned SharedWorker object.
Exceptions
SecurityErrorDomException- : 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.