YouTube - whitelist channels in uBlock Origin

To whitelist YouTube channels in uBlock Origin

目前為 2015-10-21 提交的版本,檢視 最新版本

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

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

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

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

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

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

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

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

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

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

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

作者
gorhill
評價
0 0 0
版本
1.1
建立日期
2015-10-20
更新日期
2015-10-21
尺寸
1.6 KB
授權條款
http://creativecommons.org/licenses/by-sa/4.0/
腳本執行於

Source: https://github.com/gorhill/uBlock/wiki/How-to-whitelist-a-web-site#a-youtube-channel

  • Install the user script.
  • Locate and copy the Youtube channel owner's name.
  • Once you have the channel owner's name:
    • Go to the Whitelist pane in uBlock Origin's dashboard.
    • Add the line *youtube.com/*user=[CHANNEL_OWNER'S_NAME]*.
    • Replace [CHANNEL_OWNER'S_NAME] with the channel owner's name you extracted earlier.
    • Example: *youtube.com/*user=jacksfilms*.
    • Click Apply changes once you added the whitelist directive.

Optionally, add the following bookmarklet to your toolbar: it will create a whitelist directive for you to add to uBlock Origin for the channel owner of the current Youtube page:

  • Chromium-based browsers: right-click on the toolbar, select "Add page..."
  • Firefox-based browsers: right-click on the toolbar, select "New Bookmark..."
  • Fill in the fields:
    • Name: "uBO: YT channel whitelist directive" (change as you wish)
    • URL/location: javascript:(function()%20%7B%0A%09'use%20strict'%3B%0A%09var%20link%20%3D%20document.querySelector('link%5Bhref*%3D%22%2Fuser%2F%22%5D')%3B%0A%09if%20(%20link%20!%3D%3D%20null%20)%20%7B%0A%09%09var%20pos%20%3D%20link.href.lastIndexOf('%2F')%3B%0A%09%09if%20(%20pos%20!%3D%3D%20-1%20)%20%7B%0A%09%09%09var%20filter%20%3D%20'*youtube.com%2F*user%3D'%20%2B%20link.href.slice(pos%20%2B%201)%20%2B%20'*'%3B%0A%09%09%09alert('uBO%20whitelist%20directive%20for%20this%20channel%3A%5Cn'%20%2B%20filter)%3B%0A%09%09%09return%3B%0A%09%09%7D%0A%09%7D%0A%09alert('No%20Youtube%20user%20name%20found%20on%20this%20page.')%3B%0A%7D)()%3B
  • Click "Save" or "Add".

Once you click this bookmarklet while on a Youtube page, it will extract the channel owner's name and create a valid directive to be pasted in the Whitelist pane of uBlock Origin if you want to whitelist the Youtube channel.