Created
January 11, 2021 14:16
-
-
Save Cobertos/aa8f36debf737c76ec24da77dc07b4cc to your computer and use it in GitHub Desktop.
GitHub Only Readme
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 GitHub Only Readme | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Replace the contents of a GitHub page with just the contents of the README (for a dashboard uwu) | |
// @author You | |
// @match https://github.com/Cobertos/Cobertos/blob/master/README.md | |
// @grant none | |
// ==/UserScript== | |
function documentOnlyReadme() { | |
console.log("Remove that element!"); | |
const r = document.getElementById('readme'); | |
document.replaceChild(r, document.documentElement); | |
} | |
(function() { | |
'use strict'; | |
if (document.readyState == "complete" || document.readyState == "loaded" || document.readyState == "interactive") { | |
console.log("Already Loaded"); | |
documentOnlyReadme(); | |
} else { | |
document.addEventListener("DOMContentLoaded", function(event) { | |
console.log("Just Loaded"); | |
documentOnlyReadme(); | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment