mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 10:11:46 +00:00
use apiLoaded 'once'
This commit is contained in:
@ -3,5 +3,5 @@ module.exports = () => {
|
||||
document.querySelector('video').addEventListener('loadeddata', e => {
|
||||
e.target.pause();
|
||||
})
|
||||
})
|
||||
}, { once: true, passive: true})
|
||||
};
|
||||
|
||||
@ -9,7 +9,7 @@ module.exports = (options) => {
|
||||
document.addEventListener('apiLoaded', e => {
|
||||
api = e.detail;
|
||||
firstRun(options);
|
||||
})
|
||||
}, { once: true, passive: true})
|
||||
};
|
||||
|
||||
/** Restore saved volume and setup tooltip */
|
||||
|
||||
@ -9,7 +9,7 @@ const qualitySettingsButton = ElementFromFile(
|
||||
|
||||
|
||||
module.exports = () => {
|
||||
document.addEventListener('apiLoaded', setup);
|
||||
document.addEventListener('apiLoaded', setup, { once: true, passive: true});
|
||||
}
|
||||
|
||||
function setup(event) {
|
||||
|
||||
@ -15,5 +15,5 @@ module.exports = () => {
|
||||
const data = e.detail.getPlayerResponse();
|
||||
ipcRenderer.send("song-info-request", JSON.stringify(data));
|
||||
});
|
||||
})
|
||||
}, { once: true, passive: true})
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user