您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes ads on *.yandex.ru
// ==UserScript== // @name no-yandex-ads // @namespace yandex // @description Removes ads on *.yandex.ru // @description:ru Убирает рекламу на Яндексе // @include *://*.yandex.ru/*, *://yandex.ru/* // @version 1 // @grant none // ==/UserScript== var emptyAds = '{"ads":{"ids":[],"inquire":{"dtype":"stred","path":"0"}}}'; [].forEach.call(document.querySelectorAll(".ads"), function(ad) { ad.setAttribute("data-bem", emptyAds); }); var target = document.querySelector('.b-page__inner'); var observer = new MutationObserver(function(mutations) { [].forEach.call(document.querySelectorAll(".ads"), function(ad) { var data = JSON.parse(ad.getAttribute("data-bem")).ads; data.ids.forEach(function(id, index) { data.ids[index] = "#" + id }); var selector = data.ids.join(","); [].forEach.call(document.querySelectorAll(selector), function(n) { n.remove(); }); }); }); var config = { childList: true, subtree: true }; observer.observe(target, config);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址