Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit e51278e

Browse files
Fixes assets
1 parent a76820d commit e51278e

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

tgui/public/tgui.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,17 +346,26 @@
346346
if (!sync) {
347347
node.media = 'only x';
348348
}
349+
var removeNodeAndRetry = function () {
350+
node.parentNode.removeChild(node);
351+
node = null;
352+
retry();
353+
}
354+
// 516: Chromium won't call onload() if there is a 404 error
355+
// Legacy IE doesn't use onerror, so we retain that
356+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#stylesheet_load_events
357+
node.onerror = function () {
358+
node.onerror = null;
359+
removeNodeAndRetry();
360+
}
349361
node.onload = function () {
350362
node.onload = null;
351363
if (isStyleSheetLoaded(node, url)) {
352364
// Render the stylesheet
353365
node.media = 'all';
354366
return;
355367
}
356-
// Try again
357-
node.parentNode.removeChild(node);
358-
node = null;
359-
retry();
368+
removeNodeAndRetry();
360369
};
361370
injectNode(node);
362371
return;

0 commit comments

Comments
 (0)