diff options
author | Minteck <nekostarfan@gmail.com> | 2021-06-05 19:27:48 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-06-05 19:27:48 +0200 |
commit | 8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6 (patch) | |
tree | 7096b67b189c0220826123c7d5b121752545d140 /views/script/core_viewer.js | |
download | kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.tar.gz kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.tar.bz2 kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.zip |
Presque sortie du jeu
Diffstat (limited to 'views/script/core_viewer.js')
-rw-r--r-- | views/script/core_viewer.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/views/script/core_viewer.js b/views/script/core_viewer.js new file mode 100644 index 0000000..d22ada9 --- /dev/null +++ b/views/script/core_viewer.js @@ -0,0 +1,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) +})
\ No newline at end of file |