use window.name instead of session storage

- prevents duplicate stealing session id
This commit is contained in:
pythongosssss 2023-04-23 10:31:21 +01:00
parent 6908f9c949
commit c8355ed39f
1 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class ComfyApi extends EventTarget {
}
let opened = false;
let existingSession = sessionStorage["Comfy.SessionId"] || "";
let existingSession = window.name;
if (existingSession) {
existingSession = "?clientId=" + existingSession;
}
@ -75,7 +75,7 @@ class ComfyApi extends EventTarget {
case "status":
if (msg.data.sid) {
this.clientId = msg.data.sid;
sessionStorage["Comfy.SessionId"] = this.clientId;
window.name = this.clientId;
}
this.dispatchEvent(new CustomEvent("status", { detail: msg.data.status }));
break;