-
Notifications
You must be signed in to change notification settings - Fork 0
/
content.js
63 lines (46 loc) · 1.36 KB
/
content.js
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
56
57
58
59
60
61
62
63
var parent = document.getElementsByClassName('scroll_fix_wrap')[0];
var observer = new MutationObserver(function (mutations) {
var addedNodes = mutation.addedNodes;
[].forEach.call(addedNodes, function (node) {
inspect(node);
});
});
observer.observe(parent, {childList: true});
initRun();
function inspect(node) {
if (node.id === 'profile_friends') {
node.className += ' left_void';
}
if (node.id === 'profile_common_friends') {
node.className += ' left_void';
}
if (node.className.indexOf('profile_rate_warning')) {
node.className = ' left_void';
}
if (node.className.indexOf('rate_line')) {
node.className = ' left_void';
}
if (node.id === 'profile_counts') {
node.style.paddingBottom = '4px';
}
};
function initRun() {
[].forEach.call(document.querySelectorAll('#profile_friends'), function (el) {
el.className += ' left_void';
});
[].forEach.call(document.querySelectorAll('#profile_common_friends'), function (el) {
el.className += ' left_void';
});
var warning = document.querySelectorAll('.profile_rate_warning')
if (warning[0]) {
warning[0].className += ' left_void';
}
var rate = document.querySelectorAll('.rate_line');
if (rate[0]) {
rate[0].className += ' left_void';
}
var profile_counts = document.querySelectorAll('#profile_counts');
if (profile_counts[0]) {
profile_counts[0].style.paddingBottom = '4px';
}
}