New Userscript

try to take over the world!

当前为 2020-02-13 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.tampermonkey.net/index.php?version=4.9&ext=dhdg&updated=true
// @grant        GM_log
// @grant        GM_addStyle
// @include https://connect.garmin.com/modern/badges


// ==/UserScript==

(function() {
    'use strict';
GM_log("garmin cleaning waiting");

    var intervalId=setInterval(function(){
        var divs =document.getElementsByClassName("badge-available");
        //GM_log(divs);
        divs=Array.from(divs);

        divs.forEach(function(div){
            var div2=div.getElementsByClassName("badge-name")
            if(div2[0].innerHTML.startsWith('<span>Noble Warrior Hero')) {
                GM_log("garmin cleaning started");
                div.remove();
            }
            if(div2[0].innerHTML.startsWith('<span>Light. Darkness. A Balance.')) div.remove();
            if(div2[0].innerHTML.startsWith('<span>Impressive. Most Impressive.')) div.remove();
            if(div2[0].innerHTML.startsWith('<span>No, You Move')) div.remove();//
            if(div2[0].innerHTML.startsWith('<span>Higher. Further. Faster.')) div.remove();
            if(div2[0].innerHTML.startsWith('<span>I Can Do This All Day')) div.remove();
            if(div2[0].innerHTML.startsWith('<span>Nothing’s Impossible')) div.remove();
            if(div2[0].innerHTML.startsWith('<span>Rule the Galaxy')) div.remove();
            if(div2[0].innerHTML.startsWith('<span>High Ground')) div.remove();
            if(div2[0].innerHTML.startsWith('<span>On Your Left')) div.remove();
            if(div2[0].innerHTML.startsWith('<span>Try to Keep Up')) div.remove();
            if(div2[0].innerHTML.startsWith('<span>First Avenger')) div.remove();
            if(div2[0].innerHTML.startsWith('<span>Hone Your Strength')) div.remove();
            if(div2[0].innerHTML.startsWith('<span>Feel the Force Flow')) {
                div.remove();
                GM_log("garmin cleaning done");
                clearInterval(intervalId);
            }
        });

    }, 500);

})();