From 8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 5 Jun 2021 19:27:48 +0200 Subject: Presque sortie du jeu --- views/script/core_viewer.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 views/script/core_viewer.js (limited to 'views/script/core_viewer.js') 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 -- cgit