Created
February 7, 2020 03:40
-
-
Save realies/bd723b5917d79d248a95199407491a5f to your computer and use it in GitHub Desktop.
making the messenger side-bar always narrow
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 | |
// @version 0.1 | |
// @match https://www.messenger.com/* | |
// @grant GM_xmlhttpRequest | |
// @grant GM_addStyle | |
// ==/UserScript== | |
const targetCSS = document.querySelector("link[href*='FD_uqE-4yZN.css']"); | |
GM_xmlhttpRequest({ | |
method: "GET", | |
url: targetCSS.href, | |
onload: response => { | |
targetCSS.parentNode.removeChild(targetCSS); | |
GM_addStyle(response.responseText.replace(/max-width: 900px/g, "min-width: 0px")); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Exactly what I looked for! However, it worked only after I replaced the targetCSS file with 'hXBH2TDOrgy.css' - the name is dynamic and I settled on replacing line 8 with:
const targetCSS = document.getElementsByTagName("head")[0].querySelectorAll("link[href*='.css']")[2];