您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically redirect YouTube video URLs to a much privacy-friendly viewer which is the No Cookie Official YouTube Embed. Enjoy YouTube videos with no ads and trackers.
当前为
// ==UserScript== // @name YouTube to YouTube No-Cookie Embed Player // @namespace https://gist.github.com/thedoggybrad/4e17b0046ce072afc3f31610dcdef32a // @version 0.0.2 // @description Automatically redirect YouTube video URLs to a much privacy-friendly viewer which is the No Cookie Official YouTube Embed. Enjoy YouTube videos with no ads and trackers. // @author TheDoggyBrad Software Labs // @match https://www.youtube.com/* // @grant none // @license MIT--0 // ==/UserScript== (function() { 'use strict'; function redirectToEmbed() { // Get the current URL let currentUrl = window.location.href; // Check if the URL matches the YouTube video pattern let match = currentUrl.match(/https:\/\/www\.youtube\.com\/watch\?v=([a-zA-Z0-9_-]+)/); if (match) { let videoId = match[1]; let embedUrl = `https://www.youtube-nocookie.com/embed/${videoId}`; if (window.location.href !== embedUrl) { window.location.href = embedUrl; } } } redirectToEmbed(); const observer = new MutationObserver(() => { redirectToEmbed(); }); observer.observe(document, { childList: true, subtree: true }); })();