(mutationsList, observer)
| 1337 | // 移除登录弹窗 |
| 1338 | function removeLogin() { |
| 1339 | const removeLoginModal = (mutationsList, observer) => { |
| 1340 | for (const mutation of mutationsList) { |
| 1341 | for (const target of mutation.addedNodes) { |
| 1342 | if (target.nodeType != 1) return |
| 1343 | if (target.querySelector('.signFlowModal')) { |
| 1344 | let button = target.querySelector('.Button.Modal-closeButton.Button--plain'); |
| 1345 | if (button) button.click(); |
| 1346 | } else if (getXpath('//button[text()="立即登录/注册"]',target)) { |
| 1347 | target.remove(); |
| 1348 | } |
| 1349 | } |
| 1350 | } |
| 1351 | }; |
| 1352 | |
| 1353 | // 未登录时才会监听并移除登录弹窗 |
| 1354 | if(location.hostname === 'zhuanlan.zhihu.com') { // 如果是文章页 |
nothing calls this directly
no test coverage detected