Toggle Messenger Sidebar

Button to hide messengers list of conversations

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name Toggle Messenger Sidebar
// @namespace http://jamesswandale.com/
// @version 0.2
// @description Button to hide messengers list of conversations
// @match https://www.messenger.com/*
// @copyright 2015+, James Swandale
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==

$(document).ready(function() {
    $('body').append('<input type="button" value="Hide Sidebar" id="showHideButton" style="background-color:#292929; color:#FFFFFF;">');
    $("#showHideButton").css({"position":"fixed", "top":15, "left":60, "z-index":1000, "border-style":"solid", "border-width":"2px", "border-color":"#3C3C3C"});
    $("#showHideButton").click(function(){
        var convThreads = document.getElementsByClassName("_1enh")[0];
        if(convThreads.style.display == 'none'){
            convThreads.style.display = 'block';
            showHideButton.value = "Hide Sidebar";
        }else {
            convThreads.style.display = 'none';
            showHideButton.value = "Show Sidebar";
        }
    });
});