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

Commit b30262a

Browse files
Update tgui.html
1 parent 31cf7b7 commit b30262a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tgui/public/tgui.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@
318318
if (type === 'js') {
319319
var node = document.createElement('script');
320320
node.type = 'text/javascript';
321-
node.rel = 'stylesheet';
322321
node.crossOrigin = 'anonymous';
323322
node.src = url;
324323
if (sync) {
@@ -347,6 +346,14 @@
347346
if (!sync) {
348347
node.media = 'only x';
349348
}
349+
// 516: On Chromium, SecurityError is thrown when trying to
350+
// access 'CSSStyleSheet.rules' if using webroot for asset
351+
// delivery and 'crossOrigin' is not set. This problem doesn't
352+
// accur on IE, also there is no 'crossOrigin' field in 'link'
353+
// node so it would throw an exeption if you try to set.
354+
if ('crossOrigin' in node) {
355+
node.crossOrigin = 'anonymous';
356+
}
350357
var removeNodeAndRetry = function () {
351358
node.parentNode.removeChild(node);
352359
node = null;

0 commit comments

Comments
 (0)