添加 关闭知乎登录弹窗.js

This commit is contained in:
8ga 2025-11-08 16:07:59 +08:00
parent 4759e38cc1
commit 95b2bb13a5

View File

@ -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();
}
}
});
})();