给个脚本 方便
- // ==UserScript==
- // [url=home.php?mod=space&uid=5839]@name[/url] 知乎免登录
- // @namespace http://tampermonkey.net/
- // @version 0.7
- // @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 htmlObservation(mutationList,observer){
- for(let mutation of mutationList){
- if('attributes' === mutation.type && 'style' === mutation.attributeName){
- if(document.body.parentNode.style.overflow !== 'auto'){
- document.body.parentNode.style.overflow = 'auto'
- }
- }
- }
- }
- function bodyObservation(mutationList,observer){
- if(document.getElementsByClassName('signFlowModal')[0]){
- const model = document.getElementsByClassName('Modal-wrapper')[0]
- if(model){
- model.parentNode.removeChild(model)
- }
- }
- }
- document.body.parentNode.style.overflow = 'auto'
- const htmlObserverConfig = {attributes:true}
- const htmlObserver = new MutationObserver(htmlObservation)
- htmlObserver.observe(document.body.parentNode,htmlObserverConfig)
- const bodyObserverConfig = {childList:true,subtree:true}
- const bodyObserver = new MutationObserver(bodyObservation)
- bodyObserver.observe(document.body,bodyObserverConfig)
-
- })();
复制代码 |