igg-games 自動轉到檔案下載頁面

不用等待下載時的五秒

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         igg-games 自動轉到檔案下載頁面
// @namespace    http://tampermonkey.net/
// @version      2.2
// @description  不用等待下載時的五秒
// @author       BeenYan
// @match        http*://bluemediafiles.com/*
// @match        http*://bluemediafiles.eu/*
// @match        http*://bluemediafiles.homes/*
// @match        http*://bluemediafiles.net/*
// @match        http*://bluemediafiles.xyz/*
// @match        http*://bluemediafile.sbs/*
// @match        http*://dl.pcgamestorrents.org/*
// @grant        none
// @license      GPL
// ==/UserScript==

(function() {
    'use strict';
    let url = null;
    const find_source = () =>{
        for (const script of document.getElementsByTagName('script')) {
            const matches = /Goroi_n_Create_Button\("(.*)"\)/.exec(script.innerHTML);
            if (matches && matches.length === 2) {
                return matches[1];
            }
        }
    }

    const time = setInterval(()=>{
        if (url === null) url = find_source();
        if (url){
            Goroi_n_Create_Button(url);
            const form = document.querySelector('[action="get-url.php"]')
            const redirect = form.querySelector('#url').getAttribute('value');
            if (redirect !== null) {
                form.submit();
                clearInterval(time);
            }
        }
    },10);
})();