1 Star 3 Fork 0

yezhechenyang/SkipVideoAd

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
skip-ad.js 2.49 KB
一键复制 编辑 原始数据 按行查看 历史
yezhechenyang 提交于 2020-11-14 09:50 . rule update
// 腾讯、优酷和爱奇艺跳过广告
var url = window.location.href;
if(new RegExp("v.qq.com").test(url)) {
window.setInterval(function (){
let time = document.querySelectorAll(".txp_ad video");
if(time.length) {
for(let i = 0; i<time.length; i++){
time[i].currentTime = 110
}
}
}, 1000);
}else if(new RegExp("v.youku.com").test(url)) {
var timerTask = window.setInterval(function (){
//$(".h5-ext-layer").find("div").remove();$(".control-play-icon").click()
var oDiv = document.querySelectorAll(".h5-ext-layer div");
if(oDiv && oDiv.length > 0){
console.log(oDiv.length);
Array.from(oDiv).forEach(i => i.remove());
console.log("成功移除元素:.h5-ext-layer div")
var oIcon = document.getElementsByClassName("control-play-icon");
if(oIcon && oIcon.length>0) oIcon[0].click();
console.log("成功点击:.control-play-icon");
window.clearInterval(timerTask);
}else{
console.log(".h5-ext-layer div 尚未加载!!!")
}
}, 1000);
} else if(new RegExp("iqiyi.com").test(url)) {
(function(){
function callback(){
var oTime = document.querySelector(".cd-time");
if(oTime && oTime.innerText > 0) {
var oDiv = document.querySelector(".skippable-after");
if(oDiv){
oDiv.click();
console.log("成功点击 .skippable-after");
oTime.innerText = 0;
}
// tp_vip-time1 //tp_vip-free
let tpVipTime1 = document.querySelector('.tp_vip-time1');
if(tpVipTime1.innerText > 0){
let tpVipFree = document.querySelector('.tp_vip-free');
tpVipFree.click();
console.log("成功点击 .tp_vip-free");
tpVipTime1.innerText = 0;
}
// sports-cd-time sports-vip-text
let sportsCdTime = document.querySelector('.sports-cd-time');
if(sportsCdTime.innerText > 0){
let sportsVipText = document.querySelector('.sports-vip-text');
sportsVipText.click();
console.log("成功点击 .sportsVipText");
sportsCdTime.innerText = 0;
}
// tp_close-time tp_close-txt
let tpCloseTime = document.querySelector('.tp_close-time');
if(tpCloseTime.innerText > 0){
let tpCloseTxt = document.querySelector('.tp_close-txt');
tpCloseTxt.click();
console.log("成功点击 .tpCloseTxt");
tpCloseTime.innerText = 0;
}
}
}
let flashbox = document.getElementById('flashbox');
let observer = new MutationObserver(callback);
observer.observe(flashbox, { childList: true, subtree: true });
})();
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yezhechenyang/skip-video-ad.git
git@gitee.com:yezhechenyang/skip-video-ad.git
yezhechenyang
skip-video-ad
SkipVideoAd
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385