杂七杂八的脚本

自动关闭知乎登录弹窗

// ==UserScript==
// @name         杂七杂八的脚本
// @namespace    candy_muj
// @version      1.0.0
// @description  自动关闭知乎登录弹窗
// @author       CandyMuj
// @include      *://*.zhihu.com/*
// @require      https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.2.1/jquery.min.js
// @icon         https://www.google.com/s2/favicons?sz=64&domain=zhihu.com
// @grant        none
// @license      AGPL License
// @charset		 UTF-8
// ==/UserScript==

(function() {
    'use strict';

    var host = window.location.host

    // 知乎
    if(host.endsWith('zhihu.com')){
        // 关闭登录弹窗
        let canClose = 50
        let inte = setInterval(function(){
            if(canClose <= 0) clearInterval(inte)
            if($(".Modal-closeButton")){
                $(".Modal-closeButton").click()
            }
            canClose--
        },100)
    }

})();