游侠 下载免跳转

跳转来跳转去的,有意思吗?

目前为 2021-06-02 提交的版本。查看 最新版本

// ==UserScript==
// @name         游侠 下载免跳转
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  跳转来跳转去的,有意思吗?
// @author       cw2012
// @match        https://down.ali213.net/pcgame/*
// @match        https://patch.ali213.net/showpatch/*
// @icon         https://down.ali213.net/favicon.ico
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    let url, id,btnQueryStrArray,eleToHideQueryStrArray;
    switch(location.href.split('/')[2]){
        case 'patch.ali213.net':
            downloadPatch();
            break;
        case 'down.ali213.net':
            downloadSoft();
            break;
    }

    let hotNews;
    hotNews = setInterval(()=>{
        let ele = document.querySelector('a.ali-kx');
        if(ele){
            ele.style.display='none';
            clearInterval(hotNews);
        }
    },500);

    function downloadPatch(){
        id = location.href.match(/[\d]+/g)[1];
        url = `https://patch.soft128.com/down/${id}.html`;
        btnQueryStrArray=['a.normalDownContainer'];
        eleToHideQueryStrArray=['div.box518', 'div.downAddressContainer.paddingStyle'];
        updateUI();
    }

    function downloadSoft(){
        if(typeof(downID)=='undefined'){
            let timer = setInterval(()=>{
                if(downId){
                    id = downId;
                    btnQueryStrArray=['a#xz', '.detail_body_left_nav ul>li:nth-child(5)'];
                    url = `http://www.soft5566.com/down/${id}-1.html`;
                    eleToHideQueryStrArray=['#down_load'];
                    clearInterval(timer);
                    updateUI();
                }
            },1000);
        }else{
            updateUI();
        }
    }
    function updateUI(){
        let jump= ()=>{window.open(url);};
        btnQueryStrArray.forEach(item=>{
            let btn = document.querySelector(item);
            btn.onclick = null;
            btn.addEventListener('click',jump);
        })
        eleToHideQueryStrArray.forEach(item=>{
            let ele = document.querySelector(item);
            if(ele){
                ele.style.display='none';
                ele.innerText=''
            }
        })
    }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址