File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 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 ] ;
6162 var _newScriptTag = _document . createElement ( _script ) ;
6263 _newScriptTag . src = _sdkBundleUrl ;
6364 _newScriptTag . crossorigin = 'anonymous' ;
9091 }
9192 } ) ;
9293
93- // We append the script to the body because if you use an `onload` callback it could happen that
94- // the `onLoad` of the already injected SDK will be called, which breaks the setup flow.
95- document . body . appendChild ( _newScriptTag ) ;
94+ _currentScriptTag . parentNode . insertBefore ( _newScriptTag , _currentScriptTag ) ;
9695 }
9796
9897 function sdkLoaded ( callbacks , SDK ) {
107106 }
108107
109108 var initAlreadyCalled = false ;
109+ var __sentry = _window [ '__SENTRY__' ] ;
110110 // If there is a global __SENTRY__ that means that in any of the callbacks init() was already invoked
111- if ( ! ( typeof _window [ '__SENTRY__' ] === 'undefined' ) ) {
111+ if ( ! ( typeof __sentry === 'undefined' ) && __sentry . hub && __sentry . hub . getClient ( ) ) {
112112 initAlreadyCalled = true ;
113113 }
114114
You can’t perform that action at this time.
0 commit comments