mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-16 15:40:02 -04:00
fix: more service worker emu stuff
This commit is contained in:
parent
f38ea98054
commit
88d76852d6
2 changed files with 23 additions and 17 deletions
|
@ -15,9 +15,12 @@ export default function (client: ScramjetClient, self: typeof window) {
|
|||
},
|
||||
set(ctx, value: string) {
|
||||
client.cookieStore.setCookies([value], client.url);
|
||||
|
||||
if (client.serviceWorker.controller) {
|
||||
client.serviceWorker.controller!.postMessage({
|
||||
const controller = client.descriptors.get(
|
||||
"ServiceWorkerContainer.prototype.controller",
|
||||
client.serviceWorker
|
||||
);
|
||||
if (controller) {
|
||||
client.natives.call("ServiceWorker.prototype.postMessage", controller, {
|
||||
scramjet$type: "cookie",
|
||||
cookie: value,
|
||||
url: client.url.href,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue