-
-
Save MadameMinty/1fb516fcdc54d512a2c89b1b98751322 to your computer and use it in GitHub Desktop.
Making the Messenger sidebar narrow. Adapted the original script to handle dynamic CSS names, and better work with vertical screens. This will compact the sidebar when you keep Messenger window on a vertical HD screen (1080px) or snap its window to a side of a HD (960px) or ultrawide (1280px width available) screen, but will expand it on e.g. HD…
This file contains 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 Compact Messenger Sidebar | |
// @version 2 | |
// @match https://www.messenger.com/* | |
// @grant GM_xmlhttpRequest | |
// @grant GM_addStyle | |
// ==/UserScript== | |
const targetCSS = document.getElementsByTagName("head")[0].querySelectorAll("link[href*='.css']")[2]; | |
GM_xmlhttpRequest({ | |
method: "GET", | |
url: targetCSS.href, | |
onload: response => { | |
targetCSS.parentNode.removeChild(targetCSS); | |
GM_addStyle(response.responseText.replace(/max-width: 900px/g, "max-width: 1280px")); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment