"doc/vscode:/vscode.git/clone" did not exist on "28af52643a7cd93896fe1206aec591feeb1b5058"
Commit c8355ed3 authored by pythongosssss's avatar pythongosssss
Browse files

use window.name instead of session storage

- prevents duplicate stealing session id
parent 6908f9c9
...@@ -35,7 +35,7 @@ class ComfyApi extends EventTarget { ...@@ -35,7 +35,7 @@ class ComfyApi extends EventTarget {
} }
let opened = false; let opened = false;
let existingSession = sessionStorage["Comfy.SessionId"] || ""; let existingSession = window.name;
if (existingSession) { if (existingSession) {
existingSession = "?clientId=" + existingSession; existingSession = "?clientId=" + existingSession;
} }
...@@ -75,7 +75,7 @@ class ComfyApi extends EventTarget { ...@@ -75,7 +75,7 @@ class ComfyApi extends EventTarget {
case "status": case "status":
if (msg.data.sid) { if (msg.data.sid) {
this.clientId = 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 })); this.dispatchEvent(new CustomEvent("status", { detail: msg.data.status }));
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment