mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-15 12:21:47 +00:00
small readability changes
This commit is contained in:
@ -4,18 +4,19 @@ const injectListener = () => {
|
|||||||
var oldXHR = window.XMLHttpRequest;
|
var oldXHR = window.XMLHttpRequest;
|
||||||
function newXHR() {
|
function newXHR() {
|
||||||
var realXHR = new oldXHR();
|
var realXHR = new oldXHR();
|
||||||
realXHR.addEventListener("readystatechange", function() {
|
realXHR.addEventListener("readystatechange", () => {
|
||||||
if(realXHR.readyState==4 && realXHR.status==200){
|
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
|
// if the request is the contains the song info send the response to ipcMain
|
||||||
ipcRenderer.send(
|
ipcRenderer.send(
|
||||||
"song-info-request",
|
"song-info-request",
|
||||||
realXHR.responseText
|
realXHR.responseText
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
return realXHR;
|
return realXHR;
|
||||||
}
|
}
|
||||||
window.XMLHttpRequest = newXHR;
|
window.XMLHttpRequest = newXHR;
|
||||||
}
|
}
|
||||||
module.exports = injectListener
|
module.exports = injectListener;
|
||||||
|
|||||||
@ -82,4 +82,4 @@ const registerProvider = (win) => {
|
|||||||
return registerCallback;
|
return registerCallback;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = registerProvider;
|
module.exports = registerProvider;
|
||||||
|
|||||||
Reference in New Issue
Block a user