Add JavaScript disabled message and error handling to app div
This commit is contained in:
@@ -10,7 +10,14 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app">
|
||||||
|
<noscript>
|
||||||
|
<div class="noscript">
|
||||||
|
<h1>JavaScript is disabled</h1>
|
||||||
|
<p>Please enable JavaScript to use this website.</p>
|
||||||
|
</div>
|
||||||
|
</noscript>
|
||||||
|
</div>
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
22
src/main.ts
22
src/main.ts
@@ -6,14 +6,20 @@ import { initHotkey } from "./ts/hotkey";
|
|||||||
import { polyfill } from "./ts/polyfill";
|
import { polyfill } from "./ts/polyfill";
|
||||||
import { watchParamButton } from "./ts/plugins/embedscript";
|
import { watchParamButton } from "./ts/plugins/embedscript";
|
||||||
|
|
||||||
polyfill()
|
let app: App;
|
||||||
|
try {
|
||||||
|
polyfill()
|
||||||
|
|
||||||
const app = new App({
|
app = new App({
|
||||||
target: document.getElementById("app"),
|
target: document.getElementById("app"),
|
||||||
});
|
});
|
||||||
|
|
||||||
loadData()
|
loadData()
|
||||||
initHotkey()
|
initHotkey()
|
||||||
watchParamButton()
|
watchParamButton()
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error, error.stack)
|
||||||
|
alert(error)
|
||||||
|
}
|
||||||
|
|
||||||
export default app;
|
export default app;
|
||||||
Reference in New Issue
Block a user