Note: See SharedWorker() to understand usage.
SharedWorker(url)
SharedWorker(url, name)
SharedWorker(url, options)urlSee SharedWorker().
name OptionalSee SharedWorker().
options OptionalSee SharedWorker().
Note: options.sameSiteCookies only supports the value "none", which is the default.
An unpartitioned SharedWorker object.
SecurityError DomExceptionThrown if access was not granted.
See SharedWorker()
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.