PageSourceSearch

https://antwhyno-nsi-nicegui.hf.space/_nicegui/3.12.1/static/utils/resources.js

js antwhyno-nsi-nicegui.hf.space collected 2026-10-03 16:41:20 UTC 904 bytes, 27 lines download raw bytes

1const resourceLoadPromises = {};
2
3export function loadResource(url) {
4  if (resourceLoadPromises[url]) return resourceLoadPromises[url];
5  const loadPromise = new Promise((resolve, reject) => {
6    const dataAttribute = `data-${url.split("/").pop().replace(/\./g, "-")}`;
7    if (document.querySelector(`[${dataAttribute}]`)) {
8      resolve();
9      return;
10    }
11    let element;
12    if (url.endsWith(".css")) {
13      element = document.createElement("link");
14      element.setAttribute("rel", "stylesheet");
15      element.setAttribute("href", url);
16    } else if (url.endsWith(".js")) {
17      element = document.createElement("script");
18      element.setAttribute("src", url);
19    }
20    element.setAttribute(dataAttribute, "");
21    document.head.appendChild(element);
22    element.onload = resolve;
23    element.onerror = reject;
24  });
25  resourceLoadPromises[url] = loadPromise;
26  return loadPromise;
27}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.