Remove YouTube Share Identifier

Remove the "si" parameter from YouTube share links.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

作者
anhkhoakz
今日安裝
0
安裝總數
14
評價
0 0 0
版本
1.1.2
建立日期
2025-04-07
更新日期
2025-05-15
尺寸
1.9 KB
授權條款
GPLv3
腳本執行於

Remove YouTube Share Identifier

=====================================

Overview

This script uses a MutationObserver to monitor the YouTube page for the appearance of the "Share" button. When detected, it cleans the share URL by removing any parameters that start with "si=".

Greasy Fork Downloads

Example

https://youtu.be/XqZsoesa55w?si=XXXXXXXXXXXXXXXX

Will be transformed into:

https://youtu.be/XqZsoesa55w

How It Works

  1. MutationObserver Setup: The script sets up a MutationObserver to watch for changes in the document's child elements and subtree.
  2. Detecting the Copy Link Button: When a new element is added, it checks if the element is a "YT-COPY-LINK-RENDERER" (the container for the copy link button).
  3. Cleaning the Share URL: Once the copy link button is detected, it finds the input field containing the share URL, removes any parameters starting with "si=", and updates the URL.

Usage

To use this script, simply include it in a userscript manager like Tampermonkey or Greasemonkey on YouTube pages. The script will automatically clean the share URLs when the copy link button appears.

Notes

  • This script is designed to run in a browser environment.
  • It uses modern JavaScript features and may require adjustments for older browsers.
  • The script continuously updates the URL if it changes, ensuring that any new "si=" parameters are removed.