GamesGX Downloader

Skip shortener to gamesgx.net

当前为 2023-11-13 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         GamesGX Downloader
// @version      0.2
// @namespace    GamesGxDownloader
// @description  Skip shortener to gamesgx.net
// @author       GrrAmd2
// @match        https://eco-area.com/*
// @match        http://eco-area.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Obtener la parte de la URL después del dominio
    var entryPoint = window.location.pathname.split('/');

    // Comprobar si la parte después del dominio es "go"
    if (entryPoint[1] === "go") {
        // Hacer clic en el elemento con la clase 'linkprotect' si existe
        var linkProtectElement = document.querySelector('.linkprotect');
        if (linkProtectElement) {
            linkProtectElement.click();
        }
    } else {
        // Obtener el enlace de descarga del elemento con la clase 'botontour'
        var downloadLinkElement = document.querySelector(".botontour a");

        if (downloadLinkElement) {
            var url = downloadLinkElement.href;

            // Abrir la URL en una nueva pestaña
            window.open(url, "_blank");

            // Cerrar la pestaña actual después de un breve retraso (500 milisegundos)
            setTimeout(function() {
                window.close();
            }, 500);
        } else {
            console.error("No se encontró el elemento de enlace de descarga.");
        }
    }
})();