From 70c1cc3f47ab239b31e5029b2ba494048b74dbca Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Wed, 2 Dec 2020 13:29:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20[=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E7=99=BB=E9=99=86=E5=BC=B9=E7=AA=97]=EF=BC=88=E5=85=8D?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=9C=8B=E7=9F=A5=E4=B9=8E=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zhihu-Enhanced.user.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Zhihu-Enhanced.user.js b/Zhihu-Enhanced.user.js index a7b1498..401792c 100644 --- a/Zhihu-Enhanced.user.js +++ b/Zhihu-Enhanced.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name 知乎增强 -// @version 1.1.6 +// @version 1.1.7 // @author X.I.U -// @description 一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认折叠邀请 +// @description 移除登录弹窗、一键收起回答、置顶显示时间、区分问题文章、默认高清原图、默认折叠邀请 // @match *://www.zhihu.com/* // @match *://zhuanlan.zhihu.com/* // @icon https://static.zhihu.com/static/favicon.ico @@ -312,6 +312,7 @@ function addTypeTips() { } } + // 监听 XMLHttpRequest 事件 function EventXMLHttpRequest() { var _send = window.XMLHttpRequest.prototype.send @@ -324,6 +325,16 @@ function EventXMLHttpRequest() { (function() { + // 知乎免登录,来自:https://greasyfork.org/zh-CN/scripts/417126 + let removeLoginModal = e => { + if (e.target.getElementsByClassName('Modal-wrapper').length > 0) { + e.target.getElementsByClassName('Modal-wrapper')[0].remove(); + setTimeout(() => {document.documentElement.style.overflowY = 'scroll';}, 0); + } + } + document.addEventListener('DOMNodeInserted', removeLoginModal); + + // 默认折叠邀请 let timer=setInterval(function(){ if($(".QuestionInvitation-content").text().indexOf("更多推荐结果") > -1)