File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// ==UserScript==
22// @name 知乎增强
3- // @version 1.1.6
3+ // @version 1.1.7
44// @author X.I.U
5- // @description 一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认折叠邀请
5+ // @description 移除登录弹窗、 一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认折叠邀请
66// @match *://www.zhihu.com/*
77// @match *://zhuanlan.zhihu.com/*
88// @icon https://static.zhihu.com/static/favicon.ico
@@ -312,6 +312,7 @@ function addTypeTips() {
312312 }
313313}
314314
315+
315316// 监听 XMLHttpRequest 事件
316317function EventXMLHttpRequest ( ) {
317318 var _send = window . XMLHttpRequest . prototype . send
@@ -324,6 +325,16 @@ function EventXMLHttpRequest() {
324325
325326
326327( function ( ) {
328+ // 知乎免登录,来自:https://greasyfork.org/zh-CN/scripts/417126
329+ let removeLoginModal = e => {
330+ if ( e . target . getElementsByClassName ( 'Modal-wrapper' ) . length > 0 ) {
331+ e . target . getElementsByClassName ( 'Modal-wrapper' ) [ 0 ] . remove ( ) ;
332+ setTimeout ( ( ) => { document . documentElement . style . overflowY = 'scroll' ; } , 0 ) ;
333+ }
334+ }
335+ document . addEventListener ( 'DOMNodeInserted' , removeLoginModal ) ;
336+
337+
327338 // 默认折叠邀请
328339 let timer = setInterval ( function ( ) {
329340 if ( $ ( ".QuestionInvitation-content" ) . text ( ) . indexOf ( "更多推荐结果" ) > - 1 )
You can’t perform that action at this time.
0 commit comments