Last active
December 6, 2020 18:24
-
-
Save ugjka/2c3a94f8a35129ff44a419b4d79723e9 to your computer and use it in GitHub Desktop.
Facebook mobile on desktop
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 Facebook Mobile on Desktop | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.3 | |
| // @description Enhancments for FB mobile on Desktop! | |
| // @author https://github.com/ugjka/ | |
| // @match https://m.facebook.com/* | |
| // @grant none | |
| // ==/UserScript== | |
| (function () { | |
| 'use strict'; | |
| var body = document.getElementsByTagName("BODY")[0] | |
| body.style.width = "500px"; | |
| body.style.margin = "auto"; | |
| document.addEventListener("DOMNodeInserted", function () { | |
| var stories; | |
| var composer; | |
| var extra; | |
| try { | |
| stories = document.getElementById("story_bucket_viewer_content").childNodes[0]; | |
| } | |
| catch { } | |
| if (stories) { | |
| stories.style.width = "500px"; | |
| stories.style.margin = "auto"; | |
| }; | |
| try { | |
| composer = document.getElementById("composer-main-view-id") | |
| } | |
| catch { } | |
| if (composer) { | |
| composer.style.width = "500px"; | |
| composer.style.margin = "auto"; | |
| }; | |
| try { | |
| extra = document.getElementById("msite-pages-header-contents").nextSibling | |
| } | |
| catch { } | |
| if (extra) { | |
| extra.style.width = "500px"; | |
| extra.style.margin = "auto"; | |
| }; | |
| }); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment