Skip to content

Instantly share code, notes, and snippets.

@0xF6
Created May 26, 2019 22:57
Show Gist options
  • Save 0xF6/540dfcee8af44b7b0e2b136e00207ae5 to your computer and use it in GitHub Desktop.
Save 0xF6/540dfcee8af44b7b0e2b136e00207ae5 to your computer and use it in GitHub Desktop.
Yandex ads clearner
// ==UserScript==
// @name Yandex Block
// @namespace http://tampermonkey.net/
// @version 1.3
// @author Yuuki Wesp <ls-micro@ya.ru>
// @match https://yandex.ru/*
// @grant none
// @require https://code.jquery.com/jquery-3.3.1.min.js
// @require https://code.jquery.com/ui/1.12.1/jquery-ui.min.js
// ==/UserScript==
(function() {
'use strict';
var $ = jQuery.noConflict();
let safe = (f) => { try { f(); } catch(e) { console.log(e); } }
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
var observer = new MutationObserver((mutations, observer) => {
safe(() => { $(".adv").remove(); });
safe(() => { $("[aria-label='Реклама']").remove(); });
safe(() => { $("[href='https://direct.yandex.ru/?partner']").parent().parent().remove(); });
safe(() => { $('[data-blockname="kinopoisk"]').remove(); });
safe(() => { $('[data-blockname="afisha_inserts"]').remove(); });
safe(() => { $('[data-blockname="tv_online"]').remove(); });
safe(() => { $('[data-blockname="infinity_zen"]').remove(); });
safe(() => { $('[data-blockname="infinity_zen"]').remove(); });
});
observer.observe(document, {
subtree: true,
childList: true
});
})();
@ip75
Copy link

ip75 commented Jun 13, 2022

do not work

@0xF6
Copy link
Author

0xF6 commented Jun 13, 2022

@ip75 Didn't it bother you that the script is 3 years old?
use ublock+additional filter for trim yandex direct ads

@ip75
Copy link

ip75 commented Jun 13, 2022

I left a comment to the owner to remove the wrong script

@ip75
Copy link

ip75 commented Jun 13, 2022

ublock+additional filter for trim yandex direct ads

does not work too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment