Inject JS to remove download button
This commit is contained in:
parent
02c8f7b038
commit
d62a0fd580
@ -16,7 +16,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<webview id="discord" src="https://discordapp.com/login"></webview>
|
<webview id="discord" webpreferences="plugins=false, webgl=false, enableRemoteModule=false" src="https://discordapp.com/login"></webview>
|
||||||
|
|
||||||
<script src="./renderer.js"></script>
|
<script src="./renderer.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
6
main.js
6
main.js
@ -12,8 +12,8 @@ let devMode = false
|
|||||||
function createWindow () {
|
function createWindow () {
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
width: 1000,
|
width: 1230,
|
||||||
height: 750,
|
height: 730,
|
||||||
icon: './assets/icon.ico',
|
icon: './assets/icon.ico',
|
||||||
frame: false,
|
frame: false,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
@ -77,7 +77,7 @@ function muteDelay() {
|
|||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
return resolve(true)
|
return resolve(true)
|
||||||
}, 10);
|
}, 1300); // big fat push to talk delay .com
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,12 @@ onload = () => {
|
|||||||
if (e.message === "Constructed RTCPeerConnection") {
|
if (e.message === "Constructed RTCPeerConnection") {
|
||||||
console.log("Connected to server")
|
console.log("Connected to server")
|
||||||
ipcRenderer.send('asynchronous-message', 'connected')
|
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") {
|
if (e.message === "Close RTCPeerConnection") {
|
||||||
|
Loading…
Reference in New Issue
Block a user