From 6bf1cc8f3139f0c92d3bcf52252301021323d26f Mon Sep 17 00:00:00 2001 From: mark beasley Date: Wed, 29 Jul 2026 18:16:03 -0700 Subject: [PATCH] ruffle: forward useRuffle to the sw.js registration in embed mode (#537) ensure ruffle embed options needed for ruffle (injectScripts and allowProxyPaths) are added to the service worker query args in embed.ts --- src/embed.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/embed.ts b/src/embed.ts index ecdc308..efeaf5a 100644 --- a/src/embed.ts +++ b/src/embed.ts @@ -112,7 +112,13 @@ class Embed extends LitElement { return; } - const name = this.swName + "?serveIndex=1"; + const swParams = new URLSearchParams(); + swParams.set("serveIndex", "1"); + if (this.useRuffle) { + swParams.set("injectScripts", "ruffle/ruffle.js"); + swParams.set("allowProxyPaths", "ruffle/"); + } + const name = this.swName + "?" + swParams.toString(); const appName = this.appName; const scope = this.replaybase; const requireSubdomainIframe = this.requireSubdomainIframe;