您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove the &t=*s parameter from YouTube URLs
// ==UserScript== // @name YouTube Time Parameter Remover // @namespace http://tampermonkey.net/ // @version 1.0 // @description Remove the &t=*s parameter from YouTube URLs // @author Rehan Ahmad // @match https://www.youtube.com/* // @icon https://raw.githubusercontent.com/r280822a/YouTube-Time-Parameter-Remover/refs/heads/main/icon/icon.png // @grant none // ==/UserScript== (function () { 'use strict'; function cleanURL() { const url = new URL(window.location.href); const params = url.searchParams; // If 't' parameter exists, remove it if (params.has('t')) { params.delete('t'); const cleanUrl = url.origin + url.pathname + '?' + params.toString(); // Replace the URL without reloading the page window.history.replaceState({}, '', cleanUrl); console.log('Replaced timestamp parameter in URL'); } } // Run on page load window.addEventListener('load', cleanURL); // Detect URL changes let lastUrl = location.href; new MutationObserver(() => { const currentUrl = location.href; if (currentUrl !== lastUrl) { lastUrl = currentUrl; cleanURL(); } }).observe(document, { subtree: true, childList: true }); })();