您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
跳过CCTV5/5+直播广告
当前为
// ==UserScript== // @name 东京奥运会 跳过CCTV5/5+直播广告 // @namespace http://tampermonkey.net/ // @version 1.0 // @description 跳过CCTV5/5+直播广告 // @author OUSC // @match https://tv.cctv.com/live/* // @grant none // ==/UserScript== let definition = "720"; //清晰度设置:null/720/540/480/360 (function() { 'use strict'; let interval = setInterval(()=>{ try{ let videoElement = document.getElementById("h5player_player"); if(videoElement && !isNaN(videoElement.currentTime + videoElement.duration)) videoElement.currentTime = videoElement.currentTime + videoElement.duration; let tag = document.getElementById("resolution_item_" + definition +"_player"); if(tag && !!definition) tag.click(); if(videoElement && tag) { showToast("已为您跳过广告并切换至" + definition + 'P清晰度',3000); clearInterval(interval); } } catch(e){ console.log(e) } }, 100) })(); function showToast(msg, duration){ duration = isNaN(duration) ? 3000 : duration; var m = document.createElement('div'); m.innerHTML = msg; m.style.cssText="width:240px; height: 30px; background:rgba(255, 255, 255, 0.5);color:#fff; line-height:30px; text-align:center; border-radius:4px; position:fixed; bottom:50px; left:0;right: 0;margin: auto; z-index:999999;"; document.body.appendChild(m); setTimeout(function() { var d = 0.5; m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in'; m.style.opacity = '0'; setTimeout(function() { document.body.removeChild(m) }, d * 1000); }, duration); }