-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemove_Yandex_direct_and_tips.user.js
More file actions
45 lines (41 loc) · 1.45 KB
/
Remove_Yandex_direct_and_tips.user.js
File metadata and controls
45 lines (41 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// ==UserScript==
// @name Remove Yandex Direct and tips
// @namespace http://yandex.ru/maps/
// @description Remove Yandex Direct and tips
// @downloadURL https://github.com/serge-name/greasemonkey-scripts/raw/master/Remove_Yandex_direct_and_tips.user.js
// @updateURL https://github.com/serge-name/greasemonkey-scripts/raw/master/Remove_Yandex_direct_and_tips.meta.js
// @include https://yandex.ru/maps/*
// @require https://gist.githubusercontent.com/serge-name/cbcfd668b753049d3e4059998c16f126/raw/9c97aa67ff9c5d56be34a55ad6c18a314e5eb548/waitForKeyElements.js
// @grant none
// @version 0.0.2
// ==/UserScript==
function hide_direct(jNode) {
for (var i = 0; i < jNode.length; i++) {
ith = jNode.eq(i);
if (ith.attr("href") && ith.html()) {
if (ith.attr("href").match(/yandex\.ru\//) &&
ith.html().match(/Яндекс.Директ/)) {
two_levels_up = ith.parent().parent();
if (two_levels_up.html()) {
two_levels_up.attr("style", "display:none;");
}
}
}
}
}
function hide_tips(jNode) {
for (var i = 0; i < jNode.length; i++) {
ith = jNode.eq(i);
if (ith.attr("href") && ith.attr("class")) {
if (ith.attr("href").match(/yandex\.ru\//) &&
ith.attr("class") == "tip") {
ith.attr("style", "display:none;");
}
}
}
}
function hide_blocks(jNode) {
hide_direct(jNode);
hide_tips(jNode);
}
waitForKeyElements ("a", hide_blocks);