Download ComfyUI-Custom-Scripts/js/faviconStatus.js from crystantine/COMFYUI-CUSTOM-NODES: direct link, hf CLI and curl.
- Browser
- Download file 810 Bytes
-
https://huggingface.co/datasets/crystantine/COMFYUI-CUSTOM-NODES/resolve/main/ComfyUI-Custom-Scripts/js/faviconStatus.js
- Command line
-
hf download hf://datasets/crystantine/COMFYUI-CUSTOM-NODES/ComfyUI-Custom-Scripts/js/faviconStatus.js
-
curl -L -o faviconStatus.js https://huggingface.co/datasets/crystantine/COMFYUI-CUSTOM-NODES/resolve/main/ComfyUI-Custom-Scripts/js/faviconStatus.js
810 Bytes
| import { api } from "/scripts/api.js"; | |
| import { app } from "/scripts/app.js"; | |
| // Simple script that adds the current queue size to the window title | |
| // Adds a favicon that changes color while active | |
| app.registerExtension({ | |
| name: "pysssss.FaviconStatus", | |
| setup() { | |
| api.addEventListener("status", ({ detail }) => { | |
| let title = "ComfyUI"; | |
| let favicon = "favicon"; | |
| if (detail && detail.exec_info.queue_remaining) { | |
| favicon += "-active"; | |
| title = `(${detail.exec_info.queue_remaining}) ${title}`; | |
| } | |
| document.title = title; | |
| let link = document.querySelector("link[rel~='icon']"); | |
| if (!link) { | |
| link = document.createElement("link"); | |
| link.rel = "icon"; | |
| document.head.appendChild(link); | |
| } | |
| link.href = new URL(`assets/${favicon}.ico`, import.meta.url); | |
| }); | |
| }, | |
| }); | |