Greasy Fork is available in English.

Google Video Filter

Hide non-youtube videos on Google video search results. Add toggle.

Auteur
S M
Installations quotidiennes
0
Installations (total)
21
Notes
1 0 0
Version
0.1
Créé
30/06/2023
Mis à jour
30/06/2023
Licence
MIT
S'applique à

Google Video Filter

This is a userscript that modifies the Google Video search results to only display videos from youtube.com.

How it works

When the script is activated (on a Google Video search results page), it scans the page and selectively hides search results that are not from the youtube.com domain. The results are hidden by setting the display property of the search result div to 'none'.

It adds a small message to the "result-stats" div (usually located on the top of the results) indicating that non-youtube items have been hidden. Clicking this message will toggle the visibility of hidden items, alternately showing and hiding non-youtube videos each time you click.

The script uses MutationObserver to monitor the search results container. This allows it to respond dynamically when new results are loaded, such as when the user scrolls down, and to hide non-youtube videos from the new results as well.

The script will only run on Google Video search results pages, as specified by the @match line in the metadata block. It looks for tbm=vid to tell it is on the videos tab. Modify the match statement for other google domains besides .ca/.com