From 40a13ea1cf139cc6b16c74545180094a69c617fd Mon Sep 17 00:00:00 2001 From: snomiao Date: Sat, 13 Sep 2025 17:10:37 +0000 Subject: [PATCH] fix(api.ts): correct globalThis reference for location to ensure compatibility across environments --- src/scripts/api.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/scripts/api.ts b/src/scripts/api.ts index 199839f81d..b5c479986e 100644 --- a/src/scripts/api.ts +++ b/src/scripts/api.ts @@ -296,8 +296,11 @@ export class ComfyApi extends EventTarget { constructor() { super() this.user = '' - this.api_host = location.host - this.api_base = location.pathname.split('/').slice(0, -1).join('/') + this.api_host = gloablThis.location.host + this.api_base = gloablThis.location.pathname + .split('/') + .slice(0, -1) + .join('/') console.log('Running on', this.api_host) this.initialClientId = sessionStorage.getItem('clientId') }