Remove YouTube Share Identifier

Remove the "si" parameter from YouTube share links.

Autor
anhkhoakz
Dnevne instalacije
1
Ukupnih instalacija
2
Ocjene
0 0 0
Verzija
1.0.0
Stvoreno
07.04.2025.
Ažurirano
07.04.2025.
Size
2,32 KB
Licenza
GPLv3
Primjenjuje se

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=".

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.