Created
May 31, 2022 04:42
-
-
Save kuboon/f4a51d68fa532024e8fc0b0ab7de2088 to your computer and use it in GitHub Desktop.
Tampermonkey: auto scroll after viewed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Auto Scroll After Viewed | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Click 'Viewed' checkbox easier. | |
// @author kuboon | |
// @match https://github.com/*/files | |
// @icon https://www.google.com/s2/favicons?domain=github.com&sz=256 | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
document.addEventListener('change', el => { | |
if(el.target.classList.contains('js-reviewed-checkbox') && el.target.checked){ | |
window.scrollBy({top:62, behavior: 'smooth'}) | |
} | |
}) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment