Skip to content

Instantly share code, notes, and snippets.

@riccjohn
Last active March 29, 2024 16:08
Show Gist options
  • Save riccjohn/4d4c89d98ef312ed261b28bd34133a01 to your computer and use it in GitHub Desktop.
Save riccjohn/4d4c89d98ef312ed261b28bd34133a01 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name MetricAI Max Width
// @namespace MetricAi
// @version 2024-03-29
// @description Make content full width
// @author You
// @match *://psa.metric.ai/home/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=metric.ai
// @grant none
// ==/UserScript==
const setMaxWidth = () => {
const div = document.getElementsByClassName('content fixed-wide');
if (div.length) {
div[0].style['max-width'] = '100%';
clearInterval(interval);
}
};
const fixHeight = () => {
const main = document.getElementsByTagName('main')[0];
const mainContent = main.getElementsByClassName('content')[0];
const mainContentChild = mainContent.childNodes[0];
mainContentChild.style.flex = 'unset';
}
let interval = setInterval(() => {
setMaxWidth();
fixHeight();
}, 1000);
window.addEventListener('click', (_e) => setMaxWidth());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment