add volume hud

This commit is contained in:
Araxeus
2021-05-12 18:31:11 +03:00
parent 7942efa202
commit 7bc35f4cee
3 changed files with 40 additions and 14 deletions

View File

@ -1,5 +1,3 @@
const { isEnabled } = require("../../config/plugins");
/*
This is used to determine if plugin is actually active
(not if its only enabled in options)
@ -9,12 +7,8 @@ let enabled = false;
module.exports = (win) => {
enabled = true;
// youtube-music register some of the target listeners after DOMContentLoaded
// did-finish-load is called after all elements finished loading, including said listeners
// Thats the reason the timing is controlled from main
win.webContents.once("did-finish-load", () => {
win.webContents.send("restoreAddEventListener");
win.webContents.send("setupVideoPlayerVolumeMousewheel", !isEnabled("hide-video-player"));
win.webContents.send("did-finish-load");
});
};