Skip to content

Commit 70c1cc3

Browse files
committed
新增 [移除登陆弹窗](免登录看知乎)
1 parent 8fed07e commit 70c1cc3

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

Zhihu-Enhanced.user.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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 事件
316317
function 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)

0 commit comments

Comments
 (0)