知乎免登录

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

As of 2020-12-01. See the latest version.

// ==UserScript==
// @name         知乎免登录
// @namespace    http://tampermonkey.net/
// @version      0.6
// @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?"
    }

    document.body.addEventListener("DOMNodeInserted", function (e) {
      const model = e.target.getElementsByClassName("signFlowModal")[0]
      if (model) {
          const wrap = document.getElementsByClassName('Modal-wrapper')[0]
          wrap.parentNode.removeChild(wrap)
        document.getElementsByTagName("html")[0].style.overflow = "auto"
      }
    });
  })();