Greasy Fork is available in English.

Google Video Filter

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

Penulis
S M
Pemasangan harian
0
Total pemasangan
22
Nilai
1 0 0
Versi
0.1
Dibuat
30 Juni 2023
Diperbarui
30 Juni 2023
Lisensi
MIT
Berlaku untuk

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