Skip to content

Instantly share code, notes, and snippets.

@vikasrtr
Created October 22, 2018 05:31
Show Gist options
  • Save vikasrtr/4f69078e05757f21149b2c5055a78f34 to your computer and use it in GitHub Desktop.
Save vikasrtr/4f69078e05757f21149b2c5055a78f34 to your computer and use it in GitHub Desktop.
Chnage White Background on Pages to some grey shade for eye comfort
// Keep adding more sites
javascript:(function(){
document.body.style.backgroundColor = "#eee";
var hostname = window.location.host;
if (hostname.includes("medium.com")) {
var mediumDivs=document.getElementsByClassName("section-content");
Array.prototype.forEach.call(mediumDivs,function(e){e.style.backgroundColor="#eee"});
} else if (hostname.includes("spark.apache.org")) {
var sparkDocs=document.getElementsByClassName("container-wrapper");
Array.prototype.forEach.call(sparkDocs,function(e){e.style.backgroundColor="#eee"});
var sparkDocs=document.getElementsByClassName("content");
Array.prototype.forEach.call(sparkDocs,function(e){e.style.backgroundColor="#eee"});
} else if (hostname.includes("aws.amazon.com")) {
var amazonDocMain = document.getElementById("main");
amazonDocMain.style.backgroundColor="#eee";
} else if (hostname.includes("github.intuit.com") || hostname.includes("github.com")) {
var githubReadMe = document.getElementsByClassName("entry-content");
Array.prototype.forEach.call(githubReadMe,function(e){e.style.backgroundColor="#eee"});
}
})();
@vikasrtr
Copy link
Author

🎉 Too much room for optimisations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment