Skip to content

Commit 97e2436

Browse files
committed
BlazorMonaco doesn't like starting up from brotli compression. Removed the decompression loading from this project.
1 parent 096d52b commit 97e2436

File tree

1 file changed

+2
-23
lines changed

1 file changed

+2
-23
lines changed

src/SvgHelpers/SvgHelpers/wwwroot/index.html

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -90,33 +90,12 @@
9090
</div>
9191

9292
<!--Load required scripts for the Monaco editor-->
93+
<!--Must be done before loading blazor.webassembly.js-->
9394
<script src="_content/BlazorMonaco/jsInterop.js"></script>
9495
<script src="_content/BlazorMonaco/lib/monaco-editor/min/vs/loader.js"></script>
9596
<script src="_content/BlazorMonaco/lib/monaco-editor/min/vs/editor/editor.main.js"></script>
9697

9798
<!--Load from Brotli compressed files-->
98-
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
99-
<script type="module">
100-
import { BrotliDecode } from './js/decode.min.js';
101-
Blazor.start({
102-
loadBootResource: function (type, name, defaultUri, integrity) {
103-
if (type !== 'dotnetjs' && location.hostname !== 'localhost' && type !== 'configuration') {
104-
return (async function () {
105-
const response = await fetch(defaultUri + '.br', { cache: 'no-cache' });
106-
if (!response.ok) {
107-
throw new Error(response.statusText);
108-
}
109-
const originalResponseBuffer = await response.arrayBuffer();
110-
const originalResponseArray = new Int8Array(originalResponseBuffer);
111-
const decompressedResponseArray = BrotliDecode(originalResponseArray);
112-
const contentType = type ===
113-
'dotnetwasm' ? 'application/wasm' : 'application/octet-stream';
114-
return new Response(decompressedResponseArray,
115-
{ headers: { 'content-type': contentType } });
116-
})();
117-
}
118-
}
119-
});
120-
</script>
99+
<script src="_framework/blazor.webassembly.js"></script>
121100
</body>
122101
</html>

0 commit comments

Comments
 (0)