-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpf_declutter.user.js
More file actions
55 lines (48 loc) · 1.69 KB
/
pf_declutter.user.js
File metadata and controls
55 lines (48 loc) · 1.69 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
46
47
48
49
50
51
52
53
54
55
// ==UserScript==
// @name ProgrammersForum Hide logo, etc.
// @namespace programmersforum.ru
// @version 1.6
// @description hides the huge logo and other useless stuff
// @author Alex P
// @include *programmersforum.ru/*
// @grant none
// @run-at document-start
// @downloadURL https://github.com/AlexP11223/ProgForumRuUserscripts/raw/master/pf_declutter.user.js
// ==/UserScript==
(function() {
'use strict';
function addStyle(css) {
const styleSheet = document.createElement("style");
styleSheet.type = "text/css";
styleSheet.className = 'declutter';
styleSheet.innerHTML = css;
document.head.appendChild(styleSheet);
}
if (document.head) {
addStyle(`img[src="images/1070/misc/logo.gif"],
#header_right_cell,
div.page > div > b,
div.page > div > b + br,
div.page > div > b + br + br,
div.page > div > center,
div.page > div > center + br
{ display: none; }`);
}
document.addEventListener("DOMContentLoaded", () => {
$('img[src="images/1070/misc/logo.gif"]')
.closest('table')
.remove();
const emailRequestBlock = $('a[href^="register.php?do=requestemail"]')
.parent();
emailRequestBlock
.nextAll(':lt(2)')
.remove();
emailRequestBlock.remove();
const buyAdBlock = $('center:contains(alarforum@yandex.ru)');
buyAdBlock
.next('br')
.remove();
buyAdBlock.remove();
$('style.declutter').remove();
});
})();