您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
A bodge to get rid of those grey squares, turns out you don't _need_ to enable tracking cookies. Who knew?!
当前为
// ==UserScript== // @name Rock Paper Shotgun (RPS) - Fix YouTube Videos // @match https://www.rockpapershotgun.com/* // @grant none // @version 1.0 // @author SminkyBazzA // @description A bodge to get rid of those grey squares, turns out you don't _need_ to enable tracking cookies. Who knew?! // @license MIT // @copyright 2020, SminkyBazzA // @namespace https://gf.qytechs.cn/users/589124 // ==/UserScript== function replace_iframe(element, url) { // use cookie-less domain, ignore any querystring params (TODO: allow timestamp?) var new_url = '//www.youtube-nocookie.com'+url.pathname var new_iframe = document.createElement('iframe') // these seem to work, might need more for mobile support? new_iframe.setAttribute('src', new_url) new_iframe.setAttribute('allowfullscreen', '') new_iframe.setAttribute('width', '100%') new_iframe.setAttribute('height', '100%') // clear the junk out of the wrapper and put the clean iframe in var parent = element.parentNode parent.innerHTML = '' parent.appendChild(new_iframe) } // wait a moment after the page is ready before swapping any iframes loading from YouTube (function () { setTimeout(function () { document.querySelectorAll('.embed-wrapper iframe').forEach((element) => { var url = new URL(element.dataset.src) if (url.hostname == 'www.youtube.com') { replace_iframe(element, url) } }) }, 1000); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址