self.addEventListener("activate", (event) => {
event.waitUntil(async () => {
const subscriptions = await self.registration.cookies.getSubscriptions();
await self.registration.cookies.unsubscribe(subscriptions);
await self.registration.cookies.subscribe([
{
name: "COOKIE_NAME",
},
]);
});
});
self.addEventListener("cookiechange", (event) => {
console.log(event);
});ExtendableCookieChangeEvent / notebook
ExtendableCookieChangeEvent
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.