Greasy Fork

Greasy Fork is available in English.

Toggle Messenger Sidebar

Button to hide messengers list of conversations

当前为 2017-10-10 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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";
        }
    });
});