Auto Task Config Demo

自动任务配置文件示例

Versione datata 29/11/2023. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Auto Task Config Demo
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAABmJLR0QA/wD/AP+gvaeTAAAFyklEQVR4nO2dS2hdRRiAv5vbSsREDK3FlagYDTSlYkVw0aK4lqpJtLZa0zR0W+1KLVhBqETQrQsfTVoffQgqdFuU6kYRpTVKHyiC0GLaxIpdVNPcuJh7Md6c3jv/nHmdnPng36Snc/4z353HmfOqUD5WAeuBfqAPuAvoAW4CuurbXAYuAX8Ap4FTwI/AceCC53yXJOuAN4AfgBowbxg14GS9rHu9HsESoBvYBUxiLqBdTALP81/LSmTQA+wBpnEnojkuAi+jur1EnQqwFfgdfyKaYxrYUc+l1NyOGnBDiWiOL4DbnB5xxGwEZggvoTn+BIYcHnd0VIAxwld8q6gBeylBF1YF3iF8hevGfmC5k5qIgOXAZ4SvZGl8Cixrd3BFa0oVYBw1m8rDX8CXqInAJHAWdQZ+uf7vXcDNQC+wBnVmvx51bpOHcWAEJWhJkGfMqAFHgQ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13by24G8dqCnvsKWcrgJPAR83/b0LeAC4H3XPbS9wC+pVUI1feuNzFTMs/lzFtKX8nPEEsl/dRywW14FqMbZaRkNG6UgyIiLJiAgTGc0La0mGJYaQyThIkuEMGzKqJBlWsCVjQlBGqyg1sckotRDpQuEBFs+mqqgTR1syZl0caBEYRCbjEO5bRmnHjCQjImzJsNlNJRmakWQ4JMmIiEFkb+JxLaPUDBCXjFILkXZTWau2VeADQRntorTnGWBHxoeCMnRkRHU/k290K+ow2d2UyfeXrhWlHcAXkmRERpIRGa0q6ghJhneSjMiQyJC8oSDJMMSXjIQmvlpGQpOFMpofu7LZTSU0aSXD5nJIQpOsbmoZ5t8Lz4pSr01JyZIh+f6ejoxSr03lwXY3laa2OUgyIiMtoUeG9KphahkeyCslyXCAqZQkwwL/Ag+tV8ginTZwAAAAAElFTkSuQmCC
// @namespace    https://github.com/giveme0101/
// @version      2.5.1
// @description  自动任务配置文件示例
// @author       Kevin [email protected]
// @require      https://greatest.deepsurf.us/scripts/462822-auto-task-framework/code/Auto%20Task%20Framework.js
// @include      https://cn.bing.com/*
// @include      https://note.youdao.com/*
// @include      https://www.dqzboy.com/*.html
// @include      https://www.json.cn/*
// @include      https://www.zhihu.com/*
// @include      https://zhuanlan.zhihu.com/*
// @include      https://blog.csdn.net/*
// @run-at       document-idles
// @noframes
// ==/UserScript==

autoTask.run([
    {
        "name": "fuck dqzboy",
        "desc": "remove block image",
        "host" : "www.dqzboy.com",
        "test": true,
        "param": {},
        "action": function(param){
            document.querySelectorAll(".wp-block-image").forEach(e => e.classList.remove("wp-block-image"))
        }
    },
    {
        "name": "fuck note.youdao",
        "desc": "remove ads",
        "host" : "note.youdao.com",
        "test": true,
        "param": {},
        "action": function(param){
            let cnt = 1, scanInterval = setInterval(function(){
                const adComponent = document.querySelector("ad-component");
                const adCount = adComponent ? adComponent.childElementCount : 0;
                const listContainer = document.querySelector(".list-bd");
                if ((adCount > 0 && listContainer) || cnt++ >= 100){
                    adCount > 0 && (adComponent.remove(), listContainer.style.setProperty('top', '72px', 'important'));
                    clearInterval(scanInterval);
                }
            }, 30);
        }
    },{
        "name": "Clear Bing",
        "desc": "remove ads and '小冰'",
        "host" : "cn.bing.com",
        "test": true,
        "param": {},
        "action": function(param){
              setTimeout(function(){

                  let count = 0;

                  // 去广告Ⅰ
                  var ads = document.querySelectorAll('.b_ad');
                  ads = Array.prototype.slice.apply(ads);
                  ads.map(function (ad) {
                      count++;
                      ad.remove();
                  });

                  // 去广告Ⅱ
                  const adList = document.querySelectorAll(".b_caption");
                  for (let idx = 0; idx < adList.length; idx++){
                      try {
                          let adEle = adList[idx].children[1];
                          let adBgUrl = window.getComputedStyle(adEle, '::before').getPropertyValue("content");
                          if (adBgUrl !== 'none'){
                              count++;
                              adList[idx].parentNode.remove();
                          }
                      } catch(e) {}
                  }

                  // 去小冰
                  const bing = document.querySelector("#ev_talkbox_wrapper");
                  bing && bing.remove();

                  count && clog("Clear Bing", "", "removed Bing ads count: "+ count)

              }, 200);
        }
    },{
       "name" : "json.cn",
       "desc" : "去广告",
       "host" : "www.json.cn",
       "test" : true,
       "param": {},
       "action": function(param){
           autoTask.eleHide(".footer-gg-b-addr");
           autoTask.eleHide(document.querySelector("main").querySelector("ul"));
       }
   },{
       "name" : "zhihu.com",
       "desc" : "去登录",
       "host" : ["zhuanlan.zhihu.com","zhihu.com"],
       "test" : true,
       "param": {},
       "action": function(param){
           autoTask.eleHide(".Modal-wrapper", function(){
               document.querySelector("html").style = "";
           });
           autoTask.eleHide(".css-1wq6v87");
       }
   },{
       "name" : "csdn.net",
       "desc" : "去登录",
       "host" : "blog.csdn.net",
       "test" :  true,
       "param": {},
       "action": function(param){
           autoTask.eleHide(".passport-login-container");
       }
   }
]);