Created
March 20, 2021 04:08
-
-
Save shanehh/6214179369ea4bea29bc2905b365b580 to your computer and use it in GitHub Desktop.
Auto click hide button at github repo page
This file contains hidden or 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 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