Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Video Preview On Hover Option #2007

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

ugackMiner53
Copy link
Contributor

Adds an option to disable video playback when hovering over thumbnails on the home page.

(Fixes #1785)

How it works:
Instead of using D-Rekk's solutions of getEventListeners(node) or elem.remove(), this solution adds an event listener to the global window object, listening for global mouseenter events.

Then, if the event's composedPath property contains an element matching "#content dtd-rich-item-renderer" (which selects the thumbnail elements that listen for the mouseenter event), the event is immediately stopped with event.stopImmediatePropagation();.

The event also runs before YouTube's native events by telling the event listener to trigger during the capturing phase instead of the bubbling phase.

Notes:
The second part of the issue (for recommended video previews in the sidebar) should already be covered by the "Hide animated thumbnails" option.

This is my first commit to the codebase, so please let me know if there are any changes that need to be made to integrate it!

The setting would require a reload in order to work because the name "disable_thumbnail_playback" was different than disableHoverVideo.
Everything is now "disableThumbnailPlayback" and seems to work.
@ugackMiner53 ugackMiner53 changed the title Dsiable Video Preview On Hover Option Disable Video Preview On Hover Option Feb 11, 2024
@ImprovedTube
Copy link
Member

Tysm for caring! @ugackMiner53

@ImprovedTube ImprovedTube merged commit 20b3169 into code-charity:master Feb 13, 2024
@ImprovedTube
Copy link
Member

..then maybe💭you even have an idea how we could fix our buttons on thumbnails in youtube's feeds. (they are blocklist,
general: thumbnails: Add a popup-player-button & general: watched videos..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to disable video preview when hovering mouse over thumbnail
2 participants