-
Notifications
You must be signed in to change notification settings - Fork 24
/
linkedinAutoScroll_bookmarklet.txt
1 lines (1 loc) · 1.5 KB
/
linkedinAutoScroll_bookmarklet.txt
1
javascript:(function()%7Bfunction%20scrollToSmoothly(pos%2C%20time)%20%7Bvar%20currentPos%20%3D%20window.pageYOffset%3Bvar%20start%20%3D%20null%3Bif(time%20%3D%3D%20null)%20time%20%3D%20500%3Bpos%20%3D%20%2Bpos%2C%20time%20%3D%20%2Btime%3Bwindow.requestAnimationFrame(function%20step(currentTime)%20%7Bstart%20%3D%20!start%20%3F%20currentTime%20%3A%20start%3Bvar%20progress%20%3D%20currentTime%20-%20start%3Bif%20(currentPos%20%3C%20pos)%20%7Bwindow.scrollTo(0%2C%20((pos%20-%20currentPos)%20*%20progress%20%2F%20time)%20%2B%20currentPos)%3B%7D%20else%20%7Bwindow.scrollTo(0%2C%20currentPos%20-%20((currentPos%20-%20pos)%20*%20progress%20%2F%20time))%3B%7Dif%20(progress%20%3C%20time)%20%7Bwindow.requestAnimationFrame(step)%3B%7D%20else%20%7Bwindow.scrollTo(0%2C%20pos)%3B%7D%7D)%3B%7Dasync%20function%20expander(tag%2Cx)%7Bvar%20rando%20%3D%20(n)%20%3D%3E%20Math.round(Math.random()%20*%20n)%3Bvar%20delay%20%3D%20(ms)%20%3D%3E%20new%20Promise(res%20%3D%3E%20setTimeout(res%2C%20ms))%3BscrollToSmoothly(document.body.getBoundingClientRect().height%2C600)%3Bawait%20delay(1000)%3Blet%20see_mores%20%3D%20Array.from(document.getElementsByTagName(tag)).filter(i%3D%3E%20x.test(i.innerText))%3Bfor(let%20i%3D(see_mores.length-1)%3B%20i%3E-1%3B%20i--)%7BscrollToSmoothly(see_mores%5Bi%5D.getBoundingClientRect().y%2C500)%3Bawait%20delay(550)%3Bsee_mores%5Bi%5D.click()%3Bawait%20delay(100)%3B%7DscrollToSmoothly(document.body.getBoundingClientRect().height%2F3%2C600)%3Bawait%20delay(500)%3B%7Dexpander('button'%2C%2Fsee%20more%2Fi)%7D)()