From 95b2bb13a539b1d42320f7f55a72114c8dc55145 Mon Sep 17 00:00:00 2001 From: 8ga Date: Sat, 8 Nov 2025 16:07:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E7=9F=A5=E4=B9=8E=E7=99=BB=E5=BD=95=E5=BC=B9=E7=AA=97.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 关闭知乎登录弹窗.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 关闭知乎登录弹窗.js diff --git a/关闭知乎登录弹窗.js b/关闭知乎登录弹窗.js new file mode 100644 index 0000000..aeb4559 --- /dev/null +++ b/关闭知乎登录弹窗.js @@ -0,0 +1,24 @@ +// ==UserScript== +// @name 关闭知乎登录弹窗 +// @namespace http://tampermonkey.net/ +// @version 1.0 +// @description 关闭知乎登录弹窗 +// @author 8ga +// @match https://zhihu.com/* +// @match https://*.zhihu.com/* +// @grant none +// @run-at document-idle +// ==/UserScript== + +(function () { + 'use strict'; + window.addEventListener('load', function () { + setTimeout(clickCloseLoginButton, 1500); + function clickCloseLoginButton() { + const button = document.querySelector('button.Modal-closeButton.Button--plain'); + if (button) { + button.click(); + } + } + }); +})(); \ No newline at end of file