您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically skips YouTube ads and mutes/unmutes video for Firefox (quickly tested) and Opera (extensively tested).
当前为
// ==UserScript== // @name FuckAds - A Youtube pub skipper // @namespace http://tampermonkey.net/ // @version 4.8 // @description Automatically skips YouTube ads and mutes/unmutes video for Firefox (quickly tested) and Opera (extensively tested). // @author John Doe // @match *://www.youtube.com/* // @grant none // @license MIT // ==/UserScript== (function () { const player = document.getElementById('movie_player') const message = document.createElement('div') document.body.appendChild(message) message.style.cssText = 'position: fixed; top: 50%; left: 0; background: red; color: white; padding: 10px; z-index: 999;' let adSkipped = false let previousUrl = location.href function skipAd () { const skipButton = document.querySelector('.ytp-ad-skip-button-text') if (player && skipButton && adSkipped === false) { skipButton.click() adSkipped = true } } function startObserving () { const skipButton = document.querySelector('.ytp-ad-skip-button-text') if (!player) { message.innerText = 'Player not detected.' return } if (player.classList.contains('ad-showing') && !skipButton) { player.mute() player.style.zIndex = '-999' message.innerText = 'Player and ad detected. No skip button available, you need to wait.' return } if (player.classList.contains('ad-showing') && skipButton) { player.mute() player.style.zIndex = '-999' message.innerText = ' Skip button available, ad will be skipped ASAP.' skipAd() return } if (!player.classList.contains('ad-showing')) { message.innerText = 'No ad detected.' player.unMute() player.style.zIndex = '999' if (player.getPlayerState() !== 1 && location.href.includes('/watch') && adSkipped === false) { player.seekTo(0) player.playVideo() } adSkipped = true } } function checkUrlChange () { const currentUrl = location.href if (location.href.includes('/watch') && !adSkipped && currentUrl !== previousUrl) { adSkipped = false previousUrl = currentUrl startObserving() } } setInterval(checkUrlChange, 1000) // Continuously check for URL change setInterval(startObserving, 1000) // Continuously check for ad })()
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址