Greasy Fork is available in English.

9gag - Scroll down to current position

Scroll down back where the focus was when you clicked the arrow-up icon or scrolled up

질문, 리뷰하거나, 이 스크립트를 신고하세요.
개발자
Achernar
일일 설치수
0
총 설치수
11
평점
0 0 0
버전
0.3.1
생성
2022-09-19
갱신
2023-07-15
라이선스
없음
동작 사이트

This userscript is an attempt to allow a 9gag user to easily scroll back to the position on the page focused when he clicked the "scroll to top" icon. Or if the user scrolled up to read a comment again, and wants to resume where he was.



The userscript adds one or two button to allow you to scroll back down to the position where the viewport was when you clicked 9gag's up arrow.

Once you start scrolling the page, 9gag displays the up arrow at the bottom-right corner of the window.

If you scroll up, either manually or by clicking the up arrow, the userscript displays a down arrow in the top-right corner of the page. Clicking it moves you back to the farther position that you reached when scrolling down.
This icon disappears when you have moved down at least as far as you were, either by scrolling manually or by clicking it.

A second down arrow appears under the first one when you click the up arrow and have already scrolled a little (in short, when the first down arrow is visible). Clicking this second arrow moves you down were you where when you click the up arrow. Which is not as far as the first down arrow will bring you.
This arrow disappears when you scroll down pass the position.


The script remembers the positions for all sections visited in the same "long-lived" page (when the page is dynamically update but not fully reloaded). Say you click the "Home", scroll up/down a little ; then click "Trending", scroll there too. When you click "Home" again, 9gag remember your scrolling position, and the userscript, the state of its buttons.


For more userscripts, styles, extensions, tips, ..., visit my programming page.