BlazorWebView -> Unable to customize Blazor Startup
See original GitHub issueDescription
I’m converting a Blazor WebAssembly app to dotnet Maui and tried copying the existing WebAssembly index.html to Maui. This works great with a small change from
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
to
<script src="_framework/blazor.webview.js" autostart="false"></script>
In the WebAssembly app I am also customizing the Blazor startup:
<script>Blazor.start({ loadBootResource: loadBootResourceUpdate });</script>
When trying to use this in Maui I get the following error:

I know that loadBootResource is specific to WebAssembly but there are some other options that some users might want to use.
The issue is that initializing the WebView will automatically start Blazor without taking autostart="false" into account.
Note that this is not blocking for me as I currently don’t need this functionality but just wanted to report this issue. I was just wondering if it’s possible to have a custom startup for a blazor webview.
Steps to Reproduce
- Create a new Blazor Maui application
- Make sure
- Add
<script>Blazor.start();</script> - Notice the following error

Version with bug
Preview 10 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows
Affected platform versions
Android 11
Did you find any workaround?
No workaround as far as I am aware
Relevant log output
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)

Top Related StackOverflow Question
I must have read the old docs by accident as the JS initializers cover everything I could potentially need😄, thanks!
Oh actually it looks like maybe you already saw this doc? But it seems that with JS initializers you can probably do what you need? Right now I don’t think that
blazor.webview.jshas anything to customize, but if that changes, we would want to make sure it works with autostart=‘false’