MCPcopy
hub / github.com/pythongosssss/ComfyUI-Custom-Scripts / testUrl

Function testUrl

web/js/faviconStatus.js:18–27  ·  view source on GitHub ↗
(active)

Source from the content-addressed store, hash-verified

16
17 const getUrl = (active, user) => new URL(`assets/favicon${active ? "-active" : ""}${user ? ".user" : ""}.ico`, import.meta.url);
18 const testUrl = async (active) => {
19 const url = getUrl(active, true);
20 const r = await fetch(url, {
21 method: "HEAD",
22 });
23 if (r.status === 200) {
24 return url;
25 }
26 return getUrl(active, false);
27 };
28 const activeUrl = await testUrl(true);
29 const idleUrl = await testUrl(false);
30

Callers 1

setupFunction · 0.85

Calls 2

fetchFunction · 0.85
getUrlFunction · 0.70

Tested by

no test coverage detected