small readability changes

This commit is contained in:
Sem Visscher
2021-03-18 17:53:30 +01:00
parent d852029d25
commit 3464b0383c
2 changed files with 5 additions and 4 deletions

View File

@ -4,18 +4,19 @@ const injectListener = () => {
var oldXHR = window.XMLHttpRequest;
function newXHR() {
var realXHR = new oldXHR();
realXHR.addEventListener("readystatechange", function() {
realXHR.addEventListener("readystatechange", () => {
if(realXHR.readyState==4 && realXHR.status==200){
if (realXHR.responseURL.includes('/player'))
if (realXHR.responseURL.includes('/player')){
// if the request is the contains the song info send the response to ipcMain
ipcRenderer.send(
"song-info-request",
realXHR.responseText
);
}
}
}, false);
return realXHR;
}
window.XMLHttpRequest = newXHR;
}
module.exports = injectListener
module.exports = injectListener;