diff --git a/providers/song-info-front.js b/providers/song-info-front.js index 49d79a4b..fbc98b99 100644 --- a/providers/song-info-front.js +++ b/providers/song-info-front.js @@ -13,19 +13,20 @@ const injectListener = () => { var oldXHR = window.XMLHttpRequest; function newXHR() { var realXHR = new oldXHR(); - realXHR.addEventListener("readystatechange", () => { - if(realXHR.readyState==4 && realXHR.status==200){ - 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 - ); + realXHR.addEventListener( + "readystatechange", + () => { + if (realXHR.readyState == 4 && realXHR.status == 200) { + if (realXHR.responseURL.includes("/player")) { + // if the request contains the song info, send the response to ipcMain + ipcRenderer.send("song-info-request", realXHR.responseText); + } } - } - }, false); + }, + false + ); return realXHR; } window.XMLHttpRequest = newXHR; -} +}; module.exports = injectListener;