Skip to content

Instantly share code, notes, and snippets.

@gquittet
Created September 11, 2023 14:45
Show Gist options
  • Save gquittet/3bfa07e45713393e245e82e53d453aa1 to your computer and use it in GitHub Desktop.
Save gquittet/3bfa07e45713393e245e82e53d453aa1 to your computer and use it in GitHub Desktop.
(function () {
'use strict';
const feedContent = document.querySelector('.feed-content')
const feedMain = document.querySelector('.feed-main')
const sidebar = document.querySelector('.feed-right-sidebar')
feedContent.style.maxWidth = "unset"
feedMain.style.maxWidth = "100%"
sidebar.style.maxWidth = "unset"
sidebar.style.width = "900px"
fetch('https://github.com/dashboard-feed')
.then(response => response.text())
.then(text => {
const parser = new DOMParser();
const doc = parser.parseFromString(text, 'text/html');
// Preserving the SSO container
const dashboard = document.querySelector("#dashboard feed-container");
const main = doc.querySelector('main');
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