Greasy Fork is available in English.

低端影视去广告/自动跳转到外部网站 TENG

低端影视ddys.tv这个网站去除了视频播放开头的广告(adblocker等去广告插件需把ddys.tv添加到白名单),去首页右下角广告

// ==UserScript==
// @name         低端影视去广告/自动跳转到外部网站 TENG
// @namespace    Teng
// @version      1.300
// @description  低端影视ddys.tv这个网站去除了视频播放开头的广告(adblocker等去广告插件需把ddys.tv添加到白名单),去首页右下角广告
// @description  不求人导航子页面自动点击链接
// @description  去掉不死鸟等网站“跳转到外部网址”的安全提示
// @description  淘宝pc端店铺首页搜索框默认设置为"搜索本店"
// @description  555电影网去首页banner不健康广告
// @author       teng
// @match        http*://ddys.tv/*
// @match        http*://*.bqrdh.com/sites/*
// @match        http*://support.qq.com/products/*
// @match        http*://*.taobao.com/*
// @match        http*://www.xxttq.com/forum.php?mod=viewthread&tid=*
// @match        http*://www.jiwake.com/post/*
// @match        http*://www.52pojie.cn/thread-*
// @match        http*://*555dy7.com*
// @grant        Teng
// ==/UserScript==

(function () {
    'use strict'
	var pageUrl = window.location.href
    var pageHost = window.location.host

    //防抖函数
    function debound(fn, interval=10000){
        //第一次延迟100ms执行,后续延迟interval执行(interval默认为10000ms)
        let flag = null
        let delay = 100
        return function(){
            if(flag!==null){
                clearTimeout(flag)
                delay = interval
            }
            flag = setTimeout(()=>{
                fn()
            },delay)
        }
    }


    //低端影视处理函数
	function ddrk_handler(){
        if(document.getElementById('kasjbgih')){
            var mydiv=document.getElementById('kasjbgih')
            mydiv.style.height ='1px'
            mydiv.style.width = '1px'
            mydiv.style.position = 'absolute'
            mydiv.style.bottom = '10px'
        }
        if(document.querySelector('.cfa_popup')){
        	document.querySelector('.cfa_popup').remove()       
        }

	}
    //不求人导航处理函数
	function bqrdh_handler(){
		var childUrl = document.getElementsByClassName("site-go mt-3")[0].firstElementChild.href
        window.opener = null
        window.open('', '_self')
        window.close()
        window.open(childUrl,'_blank')
	}
    //“跳转外部网站提示”处理函数
	function qqjump_handler(){
		var childUrl = pageUrl.match(/(?<=jump=).*/)
        window.opener = null
        window.open('', '_self')
        window.close()
        window.open(childUrl,'_blank')
	}
    //淘宝pc端店铺首页/分类页搜索框默认设置为"搜索本店"
    function taobao_handler(){
        document.querySelector("#J_SearchTab>ul").firstElementChild.classList.remove("selected")
        var firstLi = document.querySelector("#J_SearchTab>ul").removeChild(document.querySelector("#J_SearchTab>ul").firstElementChild)
        document.querySelector("#J_SearchTab>ul").append(firstLi)
        document.querySelector("#J_SearchTab>ul").firstElementChild.classList.add("selected")
        document.querySelector("#J_TSearchForm").setAttribute("action","//"+pageHost+"/search.htm")
    }

    //论坛自动回帖
    function discuz_auto_reply(){
    	document.querySelector('textarea').value = '感谢楼主无私分享,万分感谢~~~'
		setTimeout("document.querySelector('.ptm button').click()", 500)
    }
    //鸡娃客自动回帖
    function jiwake_auto_reply(){
    	document.querySelector('textarea').value = '感谢楼主无私分享,万分感谢~~~'
		setTimeout("document.querySelector('.button.is-success').click()", 500)
    }

    //简单流程判断函数
	if (pageHost.includes("ddys")){
		ddrk_handler()
	}else if(pageUrl.includes("bqrdh.com/sites/")){
		bqrdh_handler()
	}else if(pageUrl.includes("jump=")){
		qqjump_handler()
	}else if(pageUrl.includes("taobao.com")){
		//淘宝pc端店铺首页/分类页
        if(document.title.indexOf("首页")==0 || pageUrl.includes("taobao.com/shop")|| pageUrl.includes("taobao.com/search")){
            taobao_handler()
        }
    }else if(pageUrl.includes("xxttq.com")||pageUrl.includes("jiwake.com")){
            //甜甜圈学习俱乐部自动回帖
            discuz_auto_reply()
    }else if(pageUrl.includes("52pojie.cn")){
            //吾爱破解自动回帖
            discuz_auto_reply()
    }else if(pageUrl.includes("jiwake.com")){
            //鸡娃客自动回帖
            jiwake_auto_reply()
    }else if(pageUrl.includes("555dy7.com")){
            //555电影去banner广告
            document.querySelector('.carousel-inner').firstElementChild.remove()
            document.querySelector('.carousel-inner').firstElementChild.classList.add('active')
    }else{
        console.log("脚本运行失败")
    }
})()