🏠 Home 

Google Video Filter

Hide non-youtube videos on Google video search r###lts. Add toggle.


Install this script?
Author
S M
Daily installs
0
Total installs
27
Ratings
1 0 0
Version
0.1
Created
2023-06-30
Updated
2023-06-30
Size
2.33 KB
License
MIT
Applies to

Google Video Filter

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

How it works

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

It adds a small message to the "r###lt-stats" div (usually located on the top of the r###lts) 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 r###lts container. This allows it to respond dynamically when new r###lts are loaded, such as when the user scrolls down, and to hide non-youtube videos from the new r###lts as well.

The script will only run on Google Video search r###lts 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