Remove YouTube Share Identifier

Remove the "si" parameter from YouTube share links.

// ==UserScript==
// @name            Remove YouTube Share Identifier
// @name:vi         Xóa Định Danh Chia Sẻ YouTube
// @namespace       https://greasyfork.org/en/users/1240674-anhkhoakz
// @version         1.0.1
// @match           *://*.youtube.com/watch*
// @license         GPLv3; https://www.gnu.org/licenses/gpl-3.0.html#license-text
// @icon            https://i.imgur.com/f1OgZDI.png
// @grant           none
// @description     Remove the "si" parameter from YouTube share links.
// @description:vi  Xóa tham số "SI" khỏi các liên kết chia sẻ YouTube.
// @author          anhkhoakz; https://www.anhkhoakz.dev/
// ==/UserScript==

(()=>{"use strict";const e=new MutationObserver(e=>{const s=e.filter(e=>e.addedNodes[0]&&e.addedNodes[0].tagName==="YT-COPY-LINK-RENDERER").map(e=>e.addedNodes[0]);if(!s.length)return;const t=s[0].querySelector("input#share-url");if(!t)return;const n=t.value.split(/[?&]/).filter(e=>!e.includes("si="));t.value=n.length>1?`${n[0]}?${n.slice(1).join("&")}`:n[0];let o=t.value;const i=()=>{if(!t)return;if(t.value===o)return;const e=t.value.split(/[?&]/).filter(e=>!e.includes("si="));t.value=e.length>1?`${e[0]}?${e.slice(1).join("&")}`:e[0],o=t.value,window.requestAnimationFrame(i)};window.requestAnimationFrame(i)});e.observe(document.documentElement,{childList:!0,subtree:!0})})()