Add fallback UI, HTTP warning, and disable Wasm native builds

Added a fallback UI in `App.razor` to handle startup failures, including a message for unsupported browsers and a reload button. Updated `blazor.web.js` to use `autostart="false"` and added JavaScript for error handling.

Introduced an HTTP warning in `LoginReceiverPage.razor` to alert users when using an unencrypted connection. Added the `IsSecureRequest` property to determine if the request is secure.

Disabled native WebAssembly builds by setting `<WasmBuildNative>` to `false` in `EnvelopeGenerator.Server.Client.csproj` and `publish.bat`.

Incremented version numbers in `EnvelopeGenerator.Server.csproj` to `1.11.0-beta`. Added new CSS classes for styling the fallback UI.
This commit is contained in:
2026-11-18 16:23:40 +01:00
parent 5c0345a810
commit ee89a794ea
6 changed files with 102 additions and 6 deletions

View File

@@ -33,13 +33,67 @@
<body>
<Routes />
<div id="sf-client-startup-fallback" class="sf-startup-fallback" hidden>
<div class="sf-startup-fallback__card" role="alert" aria-live="assertive">
<h2>Application could not start</h2>
<p>
Your browser or its current settings don't support required features.
Please update the browser or contact IT support.
</p>
<button type="button" class="btn btn-primary btn-sm" onclick="location.reload()">Reload</button>
</div>
</div>
<script src="_content/DevExpress.Blazor.Resources/js/preload-script.js"></script>
<script src="js/typed.umd.js"></script>
<script src="js/receiver-signature.js?v=9"></script>
<script src="js/signflow-theme.js"></script>
<script src="js/envelope-editor.js"></script>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_framework/blazor.web.js"></script>
<script src="_framework/blazor.web.js" autostart="false"></script>
<script>
(function () {
var started = false;
function showStartupFallback(reason) {
var root = document.getElementById('sf-client-startup-fallback');
if (!root) {
return;
}
if (reason) {
console.error('Blazor startup failed:', reason);
}
root.hidden = false;
root.style.display = 'flex';
}
if (!window.WebAssembly || !window.Blazor || typeof window.Blazor.start !== 'function') {
showStartupFallback('Browser/runtime prerequisites are missing.');
return;
}
window.addEventListener('unhandledrejection', function (event) {
if (!started) {
showStartupFallback(event.reason);
}
});
window.addEventListener('error', function (event) {
if (!started) {
showStartupFallback(event.error || event.message);
}
});
window.Blazor.start({
webAssembly: {}
}).then(function () {
started = true;
}).catch(function (error) {
showStartupFallback(error);
});
})();
</script>
</body>
</html>