-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCleanup_RBC.user.js
More file actions
33 lines (29 loc) · 1.17 KB
/
Cleanup_RBC.user.js
File metadata and controls
33 lines (29 loc) · 1.17 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
// ==UserScript==
// @name Cleanup RBC
// @namespace http://rbc.ru/
// @version 0.0.0
// @downloadURL https://github.com/serge-name/greasemonkey-scripts/raw/master/Cleanup_RBC.user.js
// @updateURL https://github.com/serge-name/greasemonkey-scripts/raw/master/Cleanup_RBC.meta.js
// @description Cleanup RBC
// @include /^https?:\/\/([^.]+\.)?rbc\.ru\//
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
// @require https://gist.githubusercontent.com/serge-name/cbcfd668b753049d3e4059998c16f126/raw/9c97aa67ff9c5d56be34a55ad6c18a314e5eb548/waitForKeyElements.js
// @grant none
// ==/UserScript==
function cleanup_push(jNode) {
// FIXME: removes popup_law too
rx0 = /^(.*\s+)?popup__push(\s+.*)?$/;
rx1 = /^(.*\s+)?popup__blackout(\s+.*)?$/;
for (var i = 0; i < jNode.length; i++) {
el = jNode.eq(i);
if (rx0.test(el.attr("class")) || rx1.test(el.attr("class"))) {
console.log('going to cleanup class "' + el.attr("class"));
el.attr("style", "display:none;");
el.empty();
}
}
}
function cleanup_div(jNode) {
cleanup_push(jNode);
}
waitForKeyElements ("div", cleanup_div, false);