Remove YouTube Share Identifier

Remove the "si" parameter from YouTube share links.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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.