forked from philbirchard/random-LinkedIn-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexpanderScroller.js
More file actions
49 lines (44 loc) · 1.19 KB
/
Copy pathexpanderScroller.js
File metadata and controls
49 lines (44 loc) · 1.19 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
function scroller() {
setTimeout(() => {
window.scrollTo(0, (document.body.scrollHeight - document.body.scrollTop) / 2);
}, 1);
setTimeout(() => {
window.scrollTo(0, document.getElementById("experience-section").scrollHeight);
}, 500);
setTimeout(() => {
window.scrollTo(0, document.body.scrollHeight);
}, 900);
setTimeout(() => {
window.scrollTo(0, document.getElementById("skill-categories-expanded").scrollHeight);
}, 1200);
}
function expander(classname) {
setTimeout(() => {
var exp = document.getElementsByClassName(classname);
for (x = 0; x < exp.length; x++) {
exp[x].click();
}
}, 2900);
}
function infiniteExpand(n) {
setTimeout(() => {
var actionBtns = document.getElementsByTagName("button");
for (a = 0; a < actionBtns.length; a++) {
var btn = actionBtns[a];
if (btn != undefined) {
if (/more(?!…)/i.test(btn.innerText) === true) {
btn.click();
}
}
}
}, ((n + 1) * 366));
}
function runFirstExpansion() {
for (x = 0; x < 8; x++) {
infiniteExpand(x);
}
}
var scr = new Promise(res => {
res(scroller());
});
scr.then(runFirstExpansion()).then(expander("lt-line-clamp__more"));