Created
December 20, 2024 15:12
-
-
Save rsteube/008a7bd5b3c1e05275f1ecfac162776f to your computer and use it in GitHub Desktop.
greasemonkey script to replace github dashboard with notification list
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 Dashboard | |
// @license MIT | |
// @match https://github.com/ | |
// @match https://github.com/dashboard | |
// ==/UserScript== | |
(function () { | |
'use strict'; | |
const feedContent = document.querySelector('.feed-content') | |
const feedMain = document.querySelector('.feed-main') | |
const sidebar = document.querySelector('.feed-right-sidebar') | |
const footer = document.querySelector('.footer') | |
const dashboard = document.querySelector("#dashboard feed-container"); | |
const copilotPreview = document.querySelector('.copilotPreview__container') | |
if (feedContent) feedContent.style.maxWidth = "unset" | |
if (feedContent) feedContent.classList.remove("border-bottom") | |
if (feedMain) feedMain.style.maxWidth = "100%" | |
if (sidebar) sidebar.remove(); | |
if (footer) footer.remove(); | |
if (dashboard) dashboard.innerHTML = ''; | |
if (copilotPreview) copilotPreview.remove(); | |
fetch('https://github.com/notifications') | |
.then(response => response.text()) | |
.then(text => { | |
const parser = new DOMParser(); | |
const doc = parser.parseFromString(text, 'text/html'); | |
const main = doc.querySelector('.notifications-list'); | |
if (dashboard && main) dashboard.replaceWith(main); | |
}) | |
.catch(error => { | |
console.error('Fetching the dashboard feed:', error); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment