[not working] gplinks auto-skip

auto-click buttons for the gplinks link shortener

当前为 2024-12-09 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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);
        }

    });

})();