From d62a0fd5803bf91471acfebb883d332f1cbeeb0c Mon Sep 17 00:00:00 2001 From: khlam <4841220+khlam@users.noreply.github.com> Date: Tue, 15 Oct 2019 21:07:17 -0700 Subject: [PATCH] Inject JS to remove download button --- index.html | 2 +- main.js | 6 +++--- renderer.js | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 5eadde3..21ef0b1 100644 --- a/index.html +++ b/index.html @@ -16,7 +16,7 @@ - + diff --git a/main.js b/main.js index 23af21e..e8bbd07 100644 --- a/main.js +++ b/main.js @@ -12,8 +12,8 @@ let devMode = false function createWindow () { // Create the browser window. mainWindow = new BrowserWindow({ - width: 1000, - height: 750, + width: 1230, + height: 730, icon: './assets/icon.ico', frame: false, webPreferences: { @@ -77,7 +77,7 @@ function muteDelay() { return new Promise((resolve) => { setTimeout(function(){ return resolve(true) - }, 10); + }, 1300); // big fat push to talk delay .com }) } diff --git a/renderer.js b/renderer.js index 66a5b96..138698c 100644 --- a/renderer.js +++ b/renderer.js @@ -9,6 +9,12 @@ onload = () => { if (e.message === "Constructed RTCPeerConnection") { console.log("Connected to server") ipcRenderer.send('asynchronous-message', 'connected') + // The only place where we execute arbitrary JS into the webview. This is to remove the download button at the bottom of the server list. + // Obviously malicious actors could take this source and create their own malicious discord client that steals auth tokens or something. + webview.executeJavaScript(` + let x = document.getElementsByClassName("listItem-2P_4kh"); + x[x.length-1].innerHTML = ""; + `) } if (e.message === "Close RTCPeerConnection") {