aboutsummaryrefslogtreecommitdiff
path: root/views/script/core_viewer.js
diff options
context:
space:
mode:
Diffstat (limited to 'views/script/core_viewer.js')
-rw-r--r--views/script/core_viewer.js23
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