aboutsummaryrefslogtreecommitdiff
path: root/views/script/core_viewer.js
blob: 389bf41c40d364262ff59381f62086a4b87d7eea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const webview = document.getElementById('wb');

webview.addEventListener('dom-ready', () => {
    document.getElementById('dummyloader').style.display = "none";
    require('@electron/remote').getCurrentWindow().log(" * " + webview.getURL());
    try {
        if (require('@electron/remote').getCurrentWindow().debug) {
            info("MainWindow", "Opening debugging tools...");
            webview.openDevTools();
        }
    } catch (e) {}
})

webview.addEventListener('dom-ready', () => {
    setInterval(() => {
        try {
            if (webview.isCrashed()) {
                require('@electron/remote').getCurrentWindow().log(" * Compositing engine crashed!");
                error("MainWindow", "Subcontainer crashed");
                crash(new Error("Webview crashed"));
            }
        } catch (e) {}
    }, 2000)
})