GamesGX Downloader

Skip shortener to gamesgx.net

目前為 2023-11-13 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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.");
        }
    }
})();