您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
删除 Wikiwand 中的多余元素。可根据你的网络状态自行调整脚本头部的重复超时值。
当前为
// ==UserScript== // @name 删除 Wikiwand 中的多余元素 // @name:en Remove Superfluous Elements in Wikiwand // @namespace Black Rabbit // @author Black Rabbit // @version 0.1.1 // @description 删除 Wikiwand 中的多余元素。可根据你的网络状态自行调整脚本头部的重复超时值。 // @description:en Remove Superfluous Elements in Wikiwand. Adjust the repeating timeout value in the head of the script according your network state. // @match *://www.wikiwand.com/* // @run-at document-start // @icon https://www.google.com/s2/favicons?sz=64&domain=wikiwand.com // @grant none // ==/UserScript== var timeout = 2000; // repeat deleting for 2000 ms var itv; var already = false; function runScript() { if (window.location.href.includes("www.wikiwand.com")) { if (window.location.pathname === '/' && !already) { itv = setInterval(homepage,50); console.log("start interval: homepage"); already = true; } else if (!already) { itv = setInterval(dtpage,50); console.log("start interval: dtpage"); already = true; } setTimeout (function () { if (already){ clearInterval (itv); console.log("stop interval"); already = false; } }, timeout); } } runScript(); var observer = new MutationObserver(function(mutations) { for (var mutation of mutations) { if (mutation.type === 'childList') { // || mutation.type === 'attributes' mutation.type === 'childList' runScript(); } } }); var targetNode = document.head; var config = { childList: true, subtree: true}; // , attributes: true, subtree: true observer.observe(targetNode, config); window.onpopstate = function (event) { //.onpopstate if (window.location.href.includes("www.wikiwand.com")) { if (window.location.pathname === '/') { // 如果路径是根目录 itv = setInterval(homepage,50); console.log("start interval: homepage"); } else { // 如果路径是其他 itv = setInterval(dtpage,50); console.log("start interval: dtpage"); } setTimeout (function () { clearInterval (itv); console.log("stop interval"); }, timeout); } }; function dtpage() { var elements = document.querySelectorAll('[class^="navbar_install__"]'); for (var e of elements) { e.style.display = "none"; } var footers = document.querySelectorAll('[class^="footer_wrapper__"]'); for (var e of footers) { e.style.display = "none"; } } function homepage() { var buttons = document.querySelectorAll('[class^="navbar_button__"]'); for (var e of buttons) { e.style.display = "none"; } var footers = document.querySelectorAll('[class^="footer_wrapper__"]'); for (var e of footers) { e.style.display = "none"; } var sticky = document.querySelectorAll('[class*="navbar_sticky__"]'); for (var e of sticky) { e.style.display = "none"; } var hero_stores = document.querySelectorAll('[class*="hero_stores__"]'); for (var e of hero_stores) { e.style.display = "none"; } var hero_videoWrapper = document.querySelectorAll('[class*="hero_videoWrapper__"]'); for (var e of hero_videoWrapper) { e.style.display = "none"; } var themes_wrapper = document.querySelectorAll('[class*="themes_wrapper__"]'); for (var e of themes_wrapper) { e.style.display = "none"; } var try_wrapper = document.querySelectorAll('[class*="try_wrapper__"]'); for (var e of try_wrapper) { e.style.display = "none"; } var listen_wrapper = document.querySelectorAll('[class*="listen_wrapper__"]'); for (var e of listen_wrapper) { e.style.display = "none"; } var features_wrapper = document.querySelectorAll('[class*="features_wrapper__"]'); for (var e of features_wrapper) { e.style.display = "none"; } var summaries_wrapper = document.querySelectorAll('[class*="summaries_wrapper__"]'); for (var e of summaries_wrapper) { e.style.display = "none"; } var support_wrapper = document.querySelectorAll('[class*="support_wrapper__"]'); for (var e of support_wrapper) { e.style.display = "none"; } var mobile_wrapper = document.querySelectorAll('[class*="mobile_wrapper__"]'); for (var e of mobile_wrapper) { e.style.display = "none"; } var bling_wrapper = document.querySelectorAll('[class*="bling_wrapper__"]'); for (var e of bling_wrapper) { e.style.display = "none"; } var underline_underline = document.querySelectorAll('[class*="underline_underline__"]'); for (var e of underline_underline) { e.style.display = "none"; } }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址