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

webview.addEventListener('dom-ready', () => {
    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)
})