🏠 Home 

Toggle Messenger Sidebar

Button to hide messengers list of conversations


Install this script?
  1. // ==UserScript==
  2. // @name Toggle Messenger Sidebar
  3. // @namespace http://jamesswandale.com/
  4. // @version 0.2
  5. // @description Button to hide messengers list of conversations
  6. // @match https://www.messenger.com/*
  7. // @copyright 2015+, James Swandale
  8. // @require http://code.jquery.com/jquery-latest.js
  9. // ==/UserScript==
  10. $(document).ready(function() {
  11. $('body').append('<input type="button" value="Hide Sidebar" id="showHideButton" style="background-color:#292929; color:#FFFFFF;">');
  12. $("#showHideButton").css({"position":"fixed", "top":15, "left":60, "z-index":1000, "border-style":"solid", "border-width":"2px", "border-color":"#3C3C3C"});
  13. $("#showHideButton").click(function(){
  14. var convThreads = document.getElementsByClassName("_1enh")[0];
  15. if(convThreads.style.display == 'none'){
  16. convThreads.style.display = 'block';
  17. showHideButton.value = "Hide Sidebar";
  18. }else {
  19. convThreads.style.display = 'none';
  20. showHideButton.value = "Show Sidebar";
  21. }
  22. });
  23. });