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