gplinks auto-skip

auto-click buttons for the gplinks link shortener

Stan na 20-03-2024. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        gplinks auto-skip
// @description auto-click buttons for the gplinks link shortener
// @version     1.0
// @include     *
// @run-at      document-start
// @namespace https://greasyfork.org/users/980489
// ==/UserScript==

(function() {
    'use strict';

    document.addEventListener('DOMContentLoaded', function() {

        // part 1
        // can't specify a domain, they add new ones daily
        let button1 = document.querySelector('#VerifyBtn');
        let button2 = document.querySelector('#NextBtn');
        if (button1 && button2) {
            setTimeout(function() {button1.click()}, 3000);
            setTimeout(function() {button2.click()}, 5000);
        }

        // part 2
        const part2domainRegex = /gplinks.co\/[^/#]+\/(?:#|\?pid=)/
        if (part2domainRegex.test(window.location.href))  {
            let button3 = document.querySelector('a.get-link');
            setTimeout(function() {button3.click()}, 6000);
        }

    });

})();