From ae0a561b046aa71763598518eac58698d877a9c8 Mon Sep 17 00:00:00 2001 From: Pierre-Alexandre Veyry Date: Wed, 16 Sep 2020 15:28:14 +0100 Subject: [PATCH] js: fix patch not showing with GHC build 20.8.301 Closes issue #15 --- js/electron_code_wrapper.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/js/electron_code_wrapper.js b/js/electron_code_wrapper.js index 4d0dc96..74a309f 100644 --- a/js/electron_code_wrapper.js +++ b/js/electron_code_wrapper.js @@ -7,12 +7,15 @@ app.on('web-contents-created', (e, webContents) => { }() ) `; - webContents.on('did-finish-load', () => { - webContents.executeJavaScript(code, true); - }); - webContents.on('before-input-event', (event, input) => { - if (input.key == "F12") { - webContents.openDevTools(); - } - }) + if (webContents.id > 3) { + webContents.on('did-finish-load', () => { + webContents.executeJavaScript(`(console.log("running better-hangoutschat..."))`); + webContents.executeJavaScript(code, true); + }); + webContents.on('before-input-event', (event, input) => { + if (input.key == "F12") { + webContents.openDevTools(); + } + }); + } })