[not working] gplinks auto-skip

auto-click buttons for the gplinks link shortener

目前為 2024-12-09 提交的版本,檢視 最新版本

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        [not working] gplinks auto-skip
// @description auto-click buttons for the gplinks link shortener
// @version     1.1
// @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);
        }

    });

})();