Greasy Fork is available in English.

知乎免登录

垃圾知乎既然逼着电脑端用短信登陆,那爷就不登陆了

Ekde 2020/11/02. Vidu La ĝisdata versio.

// ==UserScript==
// @name         知乎免登录
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  垃圾知乎既然逼着电脑端用短信登陆,那爷就不登陆了
// @author       You
// @match        https://www.zhihu.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    if(document.location.href.indexOf('/signin?') > -1){
        window.location.href = '//zhihu.com/search?'
    }

    function findSigninModel(){
        const model = document.getElementsByClassName('signFlowModal')[0]
        if(model){
            const closeButton = model.getElementsByClassName('Modal-closeButton')[0]
            if(closeButton){
                closeButton.click()
            }
        }

        requestAnimationFrame(findSigninModel)
    }
    findSigninModel()
})();