Last active
January 29, 2016 09:24
-
-
Save CezaryDanielNowak/aea19cc2b2a598ea6c69 to your computer and use it in GitHub Desktop.
Greasemonkey/Tempermonkey script to hide everything but chat on facebook
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
'use strict'; | |
var focusMode = localStorage.getItem('____focusMode') === '0' ? false : true; | |
var ENLARGE_CHATS = true; | |
var KEEP_DEFAULT_TITLE = 'Facebook'; | |
if (focusMode) { | |
var css = 'body {overflow: hidden;} #globalContainer {visibility: hidden} #pagelet_bluebar, #pagelet_canvas_nav_content, #pagelet_ticker, #pagelet_ego_pane {display: none !important}'; | |
var container = document.head || document.body; | |
var style = document.createElement('style'); | |
if (ENLARGE_CHATS) { | |
css += ' .fbDockChatTabFlyout {width: 400px !important;height:642px !important;} .fbNubGroup > .fbNub {width:400px !important;}'; | |
} | |
if (KEEP_DEFAULT_TITLE) { | |
setInterval(function() { | |
if (document.title !== KEEP_DEFAULT_TITLE) { | |
document.title = KEEP_DEFAULT_TITLE; | |
} | |
}, 200) | |
} | |
style.appendChild(document.createTextNode(css)); | |
container.appendChild(style); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment