Skip to content

Commit 758abdf

Browse files
authored
[browser] fix advanced sample (#128552)
1 parent 4e4d02a commit 758abdf

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<!-- add OpenGL emulation -->
1212
<EmccExtraLDFlags> -s USE_CLOSURE_COMPILER=1 -s LEGACY_GL_EMULATION=1 -lGL -lSDL -lidbfs.js</EmccExtraLDFlags>
1313
<!-- just to prove we don't do JS eval() -->
14-
<_ServeHeaders>$(_ServeHeaders) -h &quot;Content-Security-Policy: default-src 'self' 'wasm-unsafe-eval'&quot; -h &quot;Timing-Allow-Origin: *&quot; -h &quot;Cross-Origin-Opener-Policy: same-origin&quot; -h &quot;Cross-Origin-Embedder-Policy: require-corp&quot; </_ServeHeaders>
14+
<_ServeHeaders>$(_ServeHeaders) -h &quot;Content-Security-Policy: default-src 'self' 'wasm-unsafe-eval'&quot; -h &quot;Cross-Origin-Opener-Policy: same-origin&quot; -h &quot;Cross-Origin-Embedder-Policy: require-corp&quot; </_ServeHeaders>
1515
<!-- enable reporting to profiler in browser dev tools -->
1616
<!-- for callspec see diagnostics-tracing.md -->
1717
<WasmProfilers>browser:callspec=N:Sample</WasmProfilers>
@@ -29,6 +29,7 @@
2929
<EmccExportedRuntimeMethod Include="GL" />
3030
<NativeFileReference Include="fibonacci.c" />
3131
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)ILLink.Descriptors.xml" />
32+
<StaticWebAssetFingerprintPattern Include="JS" Pattern="advanced-sample.lib.module.js" Expression="" />
3233
</ItemGroup>
3334

3435
<Target Name="RunSample" DependsOnTargets="RunSampleWithBrowserAndSimpleServer" />

src/mono/sample/wasm/browser-advanced/wwwroot/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ try {
5555
callSpec: "N:Sample" // needs to match AOT profile
5656
};
5757
},
58-
preInit: () => { console.log('user code Module.preInit'); },
59-
preRun: () => { console.log('user code Module.preRun'); },
58+
preInit: [() => { console.log('user code Module.preInit'); }],
59+
preRun: [() => { console.log('user code Module.preRun'); }],
6060
onRuntimeInitialized: () => {
6161
console.log('user code Module.onRuntimeInitialized');
6262
// here we could use API passed into this callback
@@ -66,7 +66,7 @@ try {
6666
// This is called after all assets are loaded.
6767
console.log('user code Module.onDotnetReady');
6868
},
69-
postRun: () => { console.log('user code Module.postRun'); },
69+
postRun: [() => { console.log('user code Module.postRun'); }],
7070
out: (text) => { console.log("ADVANCED:" + text) },
7171
})
7272
.withResourceLoader((type, name, defaultUri, integrity, behavior) => {

0 commit comments

Comments
 (0)