PageSourceSearch

https://edr-module.threatdown.com/preload-helper-D5QYaGzd.js

js threatdown.com collected 2026-09-24 17:45:10 UTC 2,168 bytes, 55 lines download raw bytes

1const scriptRel = 'modulepreload';const assetsURL = function(dep, importerUrl) { return new URL(dep, importerUrl).href };const seen = {};const __vitePreload = function preload(baseModule, deps, importerUrl) {
2	let promise = Promise.resolve();
3	if (true               && deps && deps.length > 0) {
4		const links = document.getElementsByTagName("link");
5		const cspNonceMeta = document.querySelector("meta[property=csp-nonce]");
6		const cspNonce = cspNonceMeta?.nonce || cspNonceMeta?.getAttribute("nonce");
7		function allSettled(promises$2) {
8			return Promise.all(promises$2.map((p) => Promise.resolve(p).then((value$1) => ({
9				status: "fulfilled",
10				value: value$1
11			}), (reason) => ({
12				status: "rejected",
13				reason
14			}))));
15		}
16		promise = allSettled(deps.map((dep) => {
17			dep = assetsURL(dep, importerUrl);
18			if (dep in seen) return;
19			seen[dep] = true;
20			const isCss = dep.endsWith(".css");
21			const cssSelector = isCss ? "[rel=\"stylesheet\"]" : "";
22			if (!!importerUrl) for (let i$1 = links.length - 1; i$1 >= 0; i$1--) {
23				const link$1 = links[i$1];
24				if (link$1.href === dep && (!isCss || link$1.rel === "stylesheet")) return;
25			}
26			else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) return;
27			const link = document.createElement("link");
28			link.rel = isCss ? "stylesheet" : scriptRel;
29			if (!isCss) link.as = "script";
30			link.crossOrigin = "";
31			link.href = dep;
32			if (cspNonce) link.setAttribute("nonce", cspNonce);
33			document.head.appendChild(link);
34			if (isCss) return new Promise((res, rej) => {
35				link.addEventListener("load", res);
36				link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`)));
37			});
38		}));
39	}
40	function handlePreloadError(err$2) {
41		const e$1 = new Event("vite:preloadError", { cancelable: true });
42		e$1.payload = err$2;
43		window.dispatchEvent(e$1);
44		if (!e$1.defaultPrevented) throw err$2;
45	}
46	return promise.then((res) => {
47		for (const item of res || []) {
48			if (item.status !== "rejected") continue;
49			handlePreloadError(item.reason);
50		}
51		return baseModule().catch(handlePreloadError);
52	});
53};
54
55export { __vitePreload as _ };

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.