您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
I like to do a little trolling on youtube. This lets you keep adblocker on and simply replaces the video html with an iframe of the same youtube video's embed so you can keep your adblocker on. Take that, Google!
当前为
// ==UserScript== // @name Youtube adblock replace with embed // @namespace http://tampermonkey.net/ // @version 1 // @description I like to do a little trolling on youtube. This lets you keep adblocker on and simply replaces the video html with an iframe of the same youtube video's embed so you can keep your adblocker on. Take that, Google! // @author Dildoer the Cocknight // @match https://www.youtube.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @grant none // ==/UserScript== const checkElementInterval = setInterval(function() { const targetNode = document.querySelector('#title.ytd-watch-metadata h1 yt-formatted-string'); if (targetNode !== null) { clearInterval(checkElementInterval); // Clear the interval console.log('Element loaded'); document.querySelector('#player').innerHTML = `<iframe style="width: 100%; height: 65vh;" src="https://www.youtube.com/embed/${location.href.split('?v=')[1].split('&')[0]}?autoplay=1&auto_play=1"></iframe>` } }, 500); let currentURL = window.location.href; function watchURLChange() { if (window.location.href !== currentURL) { console.log('URL changed'); currentURL = window.location.href; document.querySelector('#player').innerHTML = `<iframe style="width: 100%; height: 65vh;" src="https://www.youtube.com/embed/${location.href.split('?v=')[1].split('&')[0]}?autoplay=1&auto_play=1"></iframe>` } } // Set up a timer to periodically check for URL changes setInterval(watchURLChange, 250);