Browse Source

fix: right controls observer

Sven 1 year ago
parent
commit
dacf288d12
2 changed files with 5 additions and 3 deletions
  1. 0 1
      src/features/volume.ts
  2. 5 2
      src/observers.ts

+ 0 - 1
src/features/volume.ts

@@ -13,7 +13,6 @@ export async function initVolumeFeatures() {
   // not technically an input element but behaves pretty much the same
   addSelectorListener<HTMLInputElement>("playerBarRightControls", "tp-yt-paper-slider#volume-slider", {
     listener: async (sliderElem) => {
-      // TODO:FIXME: broken fsr
       const volSliderCont = document.createElement("div");
       volSliderCont.id = "bytm-vol-slider-cont";
 

+ 5 - 2
src/observers.ts

@@ -150,14 +150,17 @@ export function initObservers() {
       });
 
       // #SECTION playerBarRightControls = the controls on the right side of the player bar (volume, repeat, shuffle, etc.)
-      const playerBarRightControls = ".right-controls .middle-controls-buttons";
+      const playerBarRightControls = "#right-controls";
       globservers.playerBarRightControls = new SelectorObserver(playerBarRightControls, {
         ...defaultObserverOptions,
         subtree: true,
       });
 
       globservers.playerBar.addListener(playerBarRightControls, {
-        listener: () => globservers.playerBarRightControls.enable(),
+        listener: () => {
+          console.log(">> enable playerBarRightControls");
+          globservers.playerBarRightControls.enable();
+        },
       });
 
       // #SECTION popupContainer = the container for popups (e.g. the queue popup)