Youtube scroll lock timestamp in picture-in-picture

When using Picture-in-Picture (PiP), don't scroll to the top of the page when clicking on a timestamp that displays the time of the video.

Fra 16.05.2023. Se den seneste versjonen.

Forfatter
ziopuzzle
Vurderinger
0 0 0
Versjon
1.3
Lagd
18.09.2022
Oppdatert
16.05.2023
Size
3,6 kB
Lisens
MIT
Gjelder

Youtube scroll lock time link in picture-in-picture

The playback time link in the comment is very useful.
However, it scrolls to the top of the page each time it is clicked.
If you are using picture-in-picture, it can be annoying to go back to the top of the page.
This user script is intended to remedy that.

🔍Feature
・When using picture-in-picture (in Chrome, you can select this option by right-clicking twice on video),
clicking the playback time link in the comments section will hold the scroll position (move to the top of the page for a moment).

🔧How to
・Install this userscript.

📃Change log
1.0 : release
1.1 : bugfix
1.2 : support https://gf.zukizuki.org/en/scripts/444382-youtube-mini-player
But, "delay: 500" add to the IntersectionObserver options.
ex) "threshold: 0.5" -> "threshold: 0.5, delay: 500"
1.3 : fix broken script.