mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
use front load event instead of webcontents.did-finish-load
This commit is contained in:
@ -24,10 +24,10 @@ function overrideAddEventListener() {
|
||||
|
||||
module.exports = () => {
|
||||
overrideAddEventListener();
|
||||
// Restore original function after did-finish-load to avoid keeping Element.prototype altered
|
||||
ipcRenderer.once("did-finish-load", () => { // Called from main to make sure page is completly loaded
|
||||
// Restore original function after finished loading to avoid keeping Element.prototype altered
|
||||
window.addEventListener('load', () => {
|
||||
Element.prototype.addEventListener = Element.prototype._addEventListener;
|
||||
Element.prototype._addEventListener = undefined;
|
||||
ignored = undefined;
|
||||
});
|
||||
}, { once: true });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user