Blazor WebAssembly fails in Chrome Extensions (Manifest V3) due to reserved _framework folder and hash validation #60438
Labels
area-blazor
Includes: Blazor, Razor Components
Milestone
Is there an existing issue for this?
Describe the bug
When attempting to use a Blazor WebAssembly application as part of a Chrome Extension (Manifest V3), the extension fails to load because Chrome disallows file or directory names beginning with an underscore (_). Blazor relies on a folder named _framework for its runtime, resources, and for dynamic module imports (e.g., dotnet.js). Furthermore, the blazor.boot.json file contains precomputed hashes for these resources which depend on the folder name.
Renaming the _framework folder manually (e.g., to blazor_framework) causes the hashes to mismatch and prevents the runtime from loading. Overriding the resource base path via window.__blazorBoot.bootResourceBase is insufficient since the internal logic and dynamic imports are hard-coded to reference _framework.
Expected Behavior
It should be possible to deploy a Blazor WebAssembly application within a Chrome Extension. Either Blazor should allow for configuring a different runtime resource folder name (with corresponding hash recalculation) or provide an alternative mechanism for overriding the base path for resources so that it can work within the constraints of Chrome Extension Manifest V3.
Steps To Reproduce
Exceptions (if any)
No response
.NET Version
9.0.101
Anything else?
No response
The text was updated successfully, but these errors were encountered: