79 lines
3.1 KiB
HTML
79 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
|
<title>NexusReader.Maui</title>
|
|
<base href="/" />
|
|
<link rel="stylesheet" href="_content/NexusReader.UI.Shared/app.css" />
|
|
<link rel="icon" type="image/png" href="favicon.png" />
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="app">
|
|
<div id="app-preloader">
|
|
<div class="preloader-spinner"></div>
|
|
<div class="preloader-text">Nexus Reader</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="blazor-error-ui">
|
|
An unhandled error has occurred.
|
|
<a href="" class="reload">Reload</a>
|
|
<a class="dismiss">🗙</a>
|
|
</div>
|
|
|
|
<script src="_framework/blazor.webview.js" autostart="false"></script>
|
|
<script src="_content/NexusReader.UI.Shared/js/d3.v7.min.js"></script>
|
|
<script>
|
|
window.NexusLogging = {
|
|
initializeBridge: function (dotNetHelper) {
|
|
const originalLog = console.log;
|
|
const originalWarn = console.warn;
|
|
const originalError = console.error;
|
|
|
|
console.log = function (...args) {
|
|
originalLog.apply(console, args);
|
|
try {
|
|
dotNetHelper.invokeMethodAsync('LogJsMessage', 'info', args.map(x => typeof x === 'object' ? JSON.stringify(x) : String(x)).join(' '));
|
|
} catch (e) {}
|
|
};
|
|
|
|
console.warn = function (...args) {
|
|
originalWarn.apply(console, args);
|
|
try {
|
|
dotNetHelper.invokeMethodAsync('LogJsMessage', 'warn', args.map(x => typeof x === 'object' ? JSON.stringify(x) : String(x)).join(' '));
|
|
} catch (e) {}
|
|
};
|
|
|
|
console.error = function (...args) {
|
|
originalError.apply(console, args);
|
|
try {
|
|
dotNetHelper.invokeMethodAsync('LogJsMessage', 'error', args.map(x => typeof x === 'object' ? JSON.stringify(x) : String(x)).join(' '));
|
|
} catch (e) {}
|
|
};
|
|
|
|
window.onerror = function (message, source, lineno, colno, error) {
|
|
const stack = error ? error.stack : '';
|
|
try {
|
|
dotNetHelper.invokeMethodAsync('LogJsMessage', 'error', `${message} at ${source}:${lineno}:${colno}`, stack);
|
|
} catch (e) {}
|
|
return false;
|
|
};
|
|
|
|
window.addEventListener('unhandledrejection', function (event) {
|
|
const reason = event.reason;
|
|
const message = reason instanceof Error ? reason.message : String(reason);
|
|
const stack = reason instanceof Error ? reason.stack : '';
|
|
try {
|
|
dotNetHelper.invokeMethodAsync('LogJsMessage', 'error', `Unhandled Promise Rejection: ${message}`, stack);
|
|
} catch (e) {}
|
|
});
|
|
}
|
|
};
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|