您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes the timestamp from URL, so it doesn't invalidate your progress when you reload the page.
- // ==UserScript==
- // @name Youtube Remove Timestamp
- // @namespace https://github.com/Alistair1231/my-userscripts/
- // @version 0.4.0
- // @description Removes the timestamp from URL, so it doesn't invalidate your progress when you reload the page.
- // @author Alistair1231
- // @match https://www.youtube.com/*
- // @icon https://icons.duckduckgo.com/ip2/youtube.com.ico
- // @license MIT
- // ==/UserScript==
- // https://gf.qytechs.cn/en/scripts/535336-youtube-remove-timestamp/
- // https://github.com/Alistair1231/my-userscripts/blob/master/youtube-remove-timestamp.user.js
- (function () {
- "use strict";
- function removeTimestamp() {
- if (!window.location.href.includes("https://www.youtube.com/watch")) return;
- // Parse query parameters
- const params = new URLSearchParams(window.location.search);
- if (!params.has("t")) return; // No timestamp, nothing to do
- console.log("Removing timestamp from URL");
- params.delete("t");
- const newSearch = params.toString() ? `?${params.toString()}` : "";
- const newUrl = `${window.location.origin}${window.location.pathname}${newSearch}${window.location.hash}`;
- // Only update if different
- if (window.location.href !== newUrl) {
- window.history.replaceState(null, "", newUrl);
- }
- }
- removeTimestamp();
- let lastUrl = location.href;
- setInterval(() => {
- if (location.href !== lastUrl) {
- lastUrl = location.href;
- removeTimestamp();
- }
- }, 200);
- })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址