您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
fuck爱奇艺暂停广告
// ==UserScript== // @name 取消爱奇艺暂停广告 // @namespace http://bmmmd.com/ // @version 0.5 // @description fuck爱奇艺暂停广告 // @match https://www.iqiyi.com/* // @run-at document-idle // @license GPL v3 // ==/UserScript== (function () { 'use strict'; const observer = new MutationObserver(() => { const btnplaypause = document.querySelectorAll('[data-player-hook="btnplaypause"]'); if (btnplaypause.length == 0) { return; } observer.disconnect(); const video = document.querySelector("video"); // 点击视频 video.addEventListener("click", (event) => { video.paused ? video.play() : video.pause(); event.stopPropagation(); }, true); // 暂停按钮 btnplaypause.forEach((items) => { items.addEventListener("click", (event) => { video.paused ? video.play() : video.pause(); event.stopPropagation(); }, true); }); // 空格 document.addEventListener("keydown", (event) => { if (event.code == "Space" && event.target.tagName != "INPUT") { video.paused ? video.play() : video.pause(); event.stopPropagation(); } }, true); }); const target = document.querySelector('#flashbox'); target && observer.observe(target, { childList: true, subtree: true }); })();