// ==UserScript== // @name 手机版移除知乎 App 下载 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 移除知乎 App 下载,自动取消下载提示 // @author sl00p // @match https://www.zhihu.com/* // @grant none // @run-at document-end // @downloadURL none // ==/UserScript== (function() { 'use strict'; let inter = setInterval(function() { let funList = ["Card DownloadGuide DownloadGuide-block", "DownloadGuide-inner", "Card DownloadGuide DownloadGuide-block DownloadGuide-block--active", "Card ViewAllInappCard", "OpenInAppButton OpenInApp is-shown", "Button Button--primary Button--blue", "Card TopstoryItem TopstoryItem--advertCard"]; for(let idx = 0; idx < funList.length; ++idx) { let nodes = document.getElementsByClassName(funList[idx]); for(let jdx = 0; jdx < nodes.length; ++jdx) { if(nodes[jdx] !== undefined) { nodes[jdx].remove(); } } } if(window.location.href.indexOf("oia") > 0) { window.history.back() } let mainApp = document.getElementsByClassName("MobileAppHeader-downloadLink"); for(let idx = 0; idx < mainApp.length; ++idx) { mainApp[idx].href = ""; mainApp[idx].innerText = "不上知乎?"; } let btn = document.getElementsByClassName("ModalButtonGroup ModalButtonGroup--horizontal"); if(btn && btn.length > 0) { btn[0].getElementsByClassName("Button")[0].click(); } }, 1000); })();