-
Notifications
You must be signed in to change notification settings - Fork 22
/
main.ts
33 lines (32 loc) · 1.03 KB
/
main.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import "./css/terminal7.css"
import "./css/xterm.css"
import "./css/framework7-icons.css"
import "./css/codemirror.css"
import "./css/dialog.css"
import { Terminal7 } from "./src/terminal7"
import { registerSW } from "virtual:pwa-register";
import { StatusBar, Style } from '@capacitor/status-bar';
if ("serviceWorker" in navigator) {
// && !/localhost/.test(window.location)) {
registerSW();
}
/*
* Initilization code, where terminal 7 is created and opened
*/
document.addEventListener("DOMContentLoaded", async () => {
// do nothing when running a test
if (window.__html__ == undefined) {
try {
await StatusBar.setStyle({ style: Style.Dark });
await StatusBar.show();
await StatusBar.setOverlaysWebView({ overlay: true });
} catch(e) {}
terminal7 = new Terminal7()
await terminal7.open()
}
})
window.addEventListener('beforeinstallprompt', e => {
window.installPrompt = e
// Prevent the mini-infobar from appearing on mobile
e.preventDefault();
})