fix(precise-volume): replace constructor check for volume slider #3362

Merged
franz-dc merged 1 commit from fix/precise-volume-slider-observer into master 2025-05-27 05:58:19 +00:00
franz-dc commented 2025-05-12 16:20:07 +00:00 (Migrated from github.com)

Fixes #3351

#volume-slider is not a native input element (anymore?). This now checks if it is tp-yt-paper-slider, which also acts like an input element.

Fixes #3351 `#volume-slider` is not a native input element (anymore?). This now checks if it is `tp-yt-paper-slider`, which also acts like an input element.
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2025-05-19 15:33:58 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull Request Overview

This PR fixes issue #3351 by updating the check for the volume slider element to support the new tp-yt-paper-slider component.

  • Replaces an instanceof HTMLInputElement check with a nodeName check for tp-yt-paper-slider.
  • Retains value extraction logic while updating the element type verification.
Comments suppressed due to low confidence (1)

src/plugins/precise-volume/renderer.ts:158

  • Verify that checking mutation.target.nodeName for 'TP-YT-PAPER-SLIDER' is robust, especially regarding potential case sensitivity or custom element variations.
if (mutation.target.nodeName === 'TP-YT-PAPER-SLIDER') {
## Pull Request Overview This PR fixes issue #3351 by updating the check for the volume slider element to support the new tp-yt-paper-slider component. - Replaces an instanceof HTMLInputElement check with a nodeName check for tp-yt-paper-slider. - Retains value extraction logic while updating the element type verification. <details> <summary>Comments suppressed due to low confidence (1)</summary> **src/plugins/precise-volume/renderer.ts:158** * Verify that checking mutation.target.nodeName for 'TP-YT-PAPER-SLIDER' is robust, especially regarding potential case sensitivity or custom element variations. ``` if (mutation.target.nodeName === 'TP-YT-PAPER-SLIDER') { ``` </details>
@ -160,3 +160,3 @@
const target = mutation.target;
const target = mutation.target as HTMLInputElement;
const targetValueNumeric = Number(target.value);
if (
copilot-pull-request-reviewer[bot] (Migrated from github.com) commented 2025-05-19 15:33:58 +00:00

Casting mutation.target to HTMLInputElement may be unsafe if tp-yt-paper-slider does not inherit from HTMLInputElement; consider casting to a more appropriate type or interface that represents the tp-yt-paper-slider component.

Casting mutation.target to HTMLInputElement may be unsafe if tp-yt-paper-slider does not inherit from HTMLInputElement; consider casting to a more appropriate type or interface that represents the tp-yt-paper-slider component.
JellyBrick (Migrated from github.com) approved these changes 2025-05-27 05:58:14 +00:00
JellyBrick (Migrated from github.com) left a comment

Thanks!

Thanks!
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: YTMD/youtube-music#3362
No description provided.