Google Video Filter

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
S M
今日安裝
0
安裝總數
27
評價
1 0 0
版本
0.1
建立日期
2023-06-30
更新日期
2023-06-30
尺寸
2.3 KB
授權條款
MIT
腳本執行於

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