Skip to content

Instantly share code, notes, and snippets.

@shanehh
Created March 20, 2021 04:08
Show Gist options
  • Save shanehh/6214179369ea4bea29bc2905b365b580 to your computer and use it in GitHub Desktop.
Save shanehh/6214179369ea4bea29bc2905b365b580 to your computer and use it in GitHub Desktop.
Auto click hide button at github repo page
// ==UserScript==
// @name HideFilesSection
// @namespace http://tampermonkey.net/
// @version 0.3
// @description I just need to see readme!!!
// @author lane
// @match https://github.com/*
// @exclude https://github.com/*/*/tree/*
// @grant none
// ==/UserScript==
;(async function () {
const sleep = function * (sec) {
while (true) {
yield new Promise(res => setTimeout(res, sec * 1000))
}
}
for await (const __ of sleep(0.5)) {
const e = document.querySelector('.rgh-toggle-files');
if (e) {
e.click()
break
}
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment