Skip to content

Instantly share code, notes, and snippets.

@kuboon
Created May 31, 2022 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuboon/f4a51d68fa532024e8fc0b0ab7de2088 to your computer and use it in GitHub Desktop.
Save kuboon/f4a51d68fa532024e8fc0b0ab7de2088 to your computer and use it in GitHub Desktop.
Tampermonkey: auto scroll after viewed
// ==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