aboutsummaryrefslogtreecommitdiff
path: root/views/script/core_viewer.js
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-08-05 17:29:18 +0200
committerGitHub <noreply@github.com>2021-08-05 17:29:18 +0200
commitb865b8f6586ffd4554cdfe45c739030afc882acd (patch)
tree37bcdf6575d8764b7367f34544658886879c0c5e /views/script/core_viewer.js
parent79edea37d15f88f086f7775bbbce64a57535b043 (diff)
parent7b541bbf2a8d754d26511895801d90f02cdf99f7 (diff)
downloadkartik-client-b865b8f6586ffd4554cdfe45c739030afc882acd.tar.gz
kartik-client-b865b8f6586ffd4554cdfe45c739030afc882acd.tar.bz2
kartik-client-b865b8f6586ffd4554cdfe45c739030afc882acd.zip
Merge pull request #4 from Minteck-Projects/devel
Branching 21.08
Diffstat (limited to 'views/script/core_viewer.js')
-rw-r--r--views/script/core_viewer.js42
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