diff options
Diffstat (limited to 'views/script/core_viewer.js')
-rw-r--r-- | views/script/core_viewer.js | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/views/script/core_viewer.js b/views/script/core_viewer.js index 389bf41..eac3766 100644 --- a/views/script/core_viewer.js +++ b/views/script/core_viewer.js @@ -1,24 +1,28 @@ 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 { + webview.addEventListener('dom-ready', () => { + document.getElementById('dummyloader').style.display = "none"; + require('@electron/remote').getCurrentWindow().log(" * " + webview.getURL()); + require('@electron/remote').getCurrentWindow().focus(); + webview.focus(); try { - if (webview.isCrashed()) { - require('@electron/remote').getCurrentWindow().log(" * Compositing engine crashed!"); - error("MainWindow", "Subcontainer crashed"); - crash(new Error("Webview crashed")); + if (require('@electron/remote').getCurrentWindow().debug) { + info("MainWindow", "Opening debugging tools..."); + webview.openDevTools(); } } catch (e) {} - }, 2000) -})
\ No newline at end of file + }) + + webview.addEventListener('dom-ready', () => { + setInterval(() => { + try { + if (webview.isCrashed() && !gameCrashed) { + require('@electron/remote').getCurrentWindow().log(" * Compositing engine crashed!"); + error("MainWindow", "Subcontainer crashed"); + crash(new Error("Webview crashed")); + } + } catch (e) {} + }, 2000) + }) +} catch (e) {}
\ No newline at end of file |