Last active
August 16, 2018 01:00
-
-
Save Sinfrax/84dc312bd1ee20019f5e to your computer and use it in GitHub Desktop.
Toggle Messenger Sidebar Script
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 Toggle Messenger Sidebar | |
// @namespace http://jamesswandale.com/ | |
// @version 0.1 | |
// @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:#000000; color:#FFFFFF;">'); | |
$("#showHideButton").css("position", "fixed").css("top", 15).css("left", 60); | |
$("#showHideButton").click(function(){ | |
var convThreads = document.getElementsByClassName("_1enh"); | |
if(convThreads.item().style.display == 'none'){ | |
convThreads.item().style.display = 'block'; | |
showHideButton.value = "Hide Sidebar"; | |
}else { | |
convThreads.item().style.display = 'none'; | |
showHideButton.value = "Show Sidebar"; | |
} | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment