Description
// Due to a strange behavior in macOS Catalina, we have to delay loading the WebAssembly files
// until after it finishes evaluating a <script> element that assigns a value to window.Module.
// This may be fixed in a later version of macOS/iOS, or even if not it may be possible to reduce
// this to a smaller workaround.
function addGlobalModuleScriptTagsToDocument ( callback : ( ) => void ) {
const scriptElem = document . createElement ( 'script' ) ;
// This pollutes global but is needed so it can be called from the script.
// The callback is put in the global scope so that it can be run after the script is loaded.
// onload cannot be used in this case for non-file scripts.
window [ '__wasmmodulecallback__' ] = callback ;
scriptElem . text = 'var Module; window.__wasmmodulecallback__(); delete window.__wasmmodulecallback__;' ;
document . body . appendChild ( scriptElem ) ;
}
Reactions are currently unavailable
You can’t perform that action at this time.
aspnetcore/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts
Lines 201 to 215 in 5750125