Skip to content

Instantly share code, notes, and snippets.

@marcjulianschwarz
Last active September 22, 2023 13:30
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcjulianschwarz/c20682f14fe31d0598f9ae535715c06f to your computer and use it in GitHub Desktop.
Save marcjulianschwarz/c20682f14fe31d0598f9ae535715c06f to your computer and use it in GitHub Desktop.
Bring back the old GitHub dashboard with PageExtender for Safari
if (window.location.hostname === "github.com") {
const feedContent = document.querySelector('.feed-content')
if (feedContent){
const feedMain = document.querySelector('.feed-main')
feedContent.style.maxWidth = "unset"
feedMain.style.maxWidth = "1200px"
fetch('https://github.com/dashboard-feed')
.then(response => response.text())
.then(text => {
const parser = new DOMParser();
const doc = parser.parseFromString(text, 'text/html');
const dashboard = document.querySelector("#dashboard");
const main = doc.querySelector('main');
if (dashboard && main) dashboard.innerHTML = main.innerHTML;
})
.catch(error => {
console.error('Fetching the dashboard feed:', error);
});
}
}
@marcjulianschwarz
Copy link
Author

Add this to your PageExtender js file to enjoy the old (and better) GitHub dashboard.

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