Greasy Fork is available in English.

Switch520自动关闭页面频繁跳出的弹窗

自动关闭switch520烦人的弹窗

// ==UserScript==
// @name         Switch520自动关闭页面频繁跳出的弹窗
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  自动关闭switch520烦人的弹窗
// @author       fxalll
// @match        https://www.gamer520.com/*
// @match        https://www.switch520.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=gamer520.com
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
        function autoClose() {
        var intervalTime = 300;
        var btnList = ['button.swal2-close'];
        var closeBtn = document.querySelectorAll(btnList[0])[0];
        try {
            closeBtn.click();
            clearInterval(window.interval)
        } catch {
            window.interval = setInterval(autoClose, intervalTime)
        }
    }
    autoClose();
})();