Skip to content

Commit b024902

Browse files
authored
style: simplify finding the first script in document (#3578)
1 parent 9af1886 commit b024902

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/browser/src/loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
// come out in the wrong order. Because of that we don't need async=1 as GA does.
5959
// it was probably(?) a legacy behavior that they left to not modify few years old snippet
6060
// https://www.html5rocks.com/en/tutorials/speed/script-loading/
61-
var _currentScriptTag = _document.getElementsByTagName(_script)[0];
61+
var _currentScriptTag = _document.scripts[0];
6262
var _newScriptTag = _document.createElement(_script);
6363
_newScriptTag.src = _sdkBundleUrl;
6464
_newScriptTag.setAttribute('crossorigin', 'anonymous');

0 commit comments

Comments
 (0)