diff --git a/apps/api/app/resources.ts b/apps/api/app/resources.ts index ae89c17..624e0e7 100644 --- a/apps/api/app/resources.ts +++ b/apps/api/app/resources.ts @@ -33,20 +33,35 @@ router.get("/game/:game_name/:game_version/iframe", async (ctx) => { gameInfo?.viewer?.alternate?.url && ctx.query.alternate === "1" ? gameInfo?.viewer.alternate : gameInfo.viewer; const viewerUrl = ctx.query.customViewerUrl || viewer.url; - ctx.body = ` - -
- - ${viewer.dependencies.scripts.map((dep) => `<${"script"} src='${dep}'>${"script"}>`).join("\n")} - <${"script"} src='${viewerUrl}' type='text/javascript'> ${"script"}> - ${viewer.dependencies.stylesheets - .map((dep) => ``) - .join("\n")} + const stylesheets = viewer.dependencies.stylesheets + .map((dep) => ``) + .join("\n"); + const scripts = viewer.dependencies.scripts.map((dep) => `<${"script"} src='${dep}'>${"script"}>`).join("\n"); + const viewerScript = `<${"script"} src='${viewerUrl}' type='text/javascript'>${"script"}>`; + + const template = viewer.topLevelVariable === "clash" ? ` + + + ${stylesheets} - -