diff --git a/src_web/comfyui/rgthree.ts b/src_web/comfyui/rgthree.ts index 206cb93..6e40ea2 100644 --- a/src_web/comfyui/rgthree.ts +++ b/src_web/comfyui/rgthree.ts @@ -320,11 +320,18 @@ class Rgthree extends EventTarget { LiteGraph.closeAllContextMenus(); if (e.button == 2) { const canvas = await waitForCanvas(); - new LiteGraph.ContextMenu(this.getRgthreeIContextMenuValues(), { - title: `
${logoRgthree} rgthree-comfy
`, + // Newer ComfyUI frontends render the ContextMenu title with textContent (no HTML + // parsing), which would show an HTML title as raw markup. Pass a plain-text title, + // then swap in our logo markup afterwards. + const menu = new LiteGraph.ContextMenu(this.getRgthreeIContextMenuValues(), { + title: "rgthree-comfy", left: e.clientX, top: 5, }); + const titleEl = query(".litemenu-title", menu.root); + if (titleEl) { + titleEl.innerHTML = `
${logoRgthree} rgthree-comfy
`; + } return; } if (e.button == 0) { diff --git a/web/comfyui/rgthree.js b/web/comfyui/rgthree.js index ec4bfa7..5b63959 100644 --- a/web/comfyui/rgthree.js +++ b/web/comfyui/rgthree.js @@ -188,11 +188,15 @@ class Rgthree extends EventTarget { LiteGraph.closeAllContextMenus(); if (e.button == 2) { const canvas = await waitForCanvas(); - new LiteGraph.ContextMenu(this.getRgthreeIContextMenuValues(), { - title: `
${logoRgthree} rgthree-comfy
`, + const menu = new LiteGraph.ContextMenu(this.getRgthreeIContextMenuValues(), { + title: "rgthree-comfy", left: e.clientX, top: 5, }); + const titleEl = query(".litemenu-title", menu.root); + if (titleEl) { + titleEl.innerHTML = `
${logoRgthree} rgthree-comfy
`; + } return; } if (e.button == 0) {