您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hide certain Gmail labels
// ==UserScript== // @name Gmail Label Hider (pref-based) // @namespace http://www.arthaey.com // @description Hide certain Gmail labels // @include http://gmail.google.com/* // @include https://gmail.google.com/* // @include http://mail.google.com/* // @include https://mail.google.com/* // @version 1.3 // // Backed up from http://userscripts.org/scripts/review/11774 // Last updated on 2007-08-29 // // Based on Ben Hengst's Gmail Label Hider v0.02 // License: http://creativecommons.org/licenses/GPL/2.0/ // // HOW TO USE: // // Right-click on the Greasemonkey monkey-face to access the "User Script // Commands" menu. Select the "Set list of Gmail labels to hide" menu item. // // At the prompt, type in the list of Gmail labels you want to hide, separated // by the "|" (pipe) character. // // KNOWN BUGS: // // - Sometimes the labels don't hide themselves when you open a message. I // haven't yet investigated why this is happening. // // CHANGELOG: // // v1.3 - made label names case-insenstive ("drafts" and "Drafts" are the same) // v1.2 - added ability to hide non-label things like Starred, Drafts, etc. // v1.1 - added "Show All" and "Hide Some" toggle links // v1.0 - initial release // // ==/UserScript== (function () { var TOGGLE_ID = "NavBar_Labels_ToggleLink"; function setLabelList() { var hideList = GM_getValue('hideList', null); var list = prompt("List of labels to hide, separated by '|'", hideList); if (list && list != hideList) { GM_setValue('hideList', list); window.location.reload(false); } } function hideLabels() { var hideList = GM_getValue('hideList', null); if (!hideList) return; var hideLabels = hideList.split('|'); var allDivs = document.evaluate( "//div[@class='lk cs'] | //div[@class='nl']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < allDivs.snapshotLength; i++) { var thisDiv = allDivs.snapshotItem(i); for (var j = 0; j < hideLabels.length; j++) { var regex = new RegExp("^" + hideLabels[j], "i"); if (thisDiv.textContent.match(regex)) { thisDiv.style.display = "none"; break; } } } toggleLink(); } function showLabels() { var allDivs = document.evaluate( "//div[@class='lk cs'] | //div[@class='nl']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < allDivs.snapshotLength; i++) { var thisDiv = allDivs.snapshotItem(i); thisDiv.style.display = "block"; } toggleLink(); } function addLink() { var editLabelsDiv = document.getElementById("prf_l"); if (!editLabelsDiv) return; var link = document.createElement("div"); link.id = TOGGLE_ID; link.className = "lk cs"; link.style.textAlign = "right"; toggleLink(link); editLabelsDiv.parentNode.insertBefore(link, editLabelsDiv); } function toggleLink(linkObj) { var link = linkObj; if (!link) link = document.getElementById(TOGGLE_ID); if (!link) return; if (link.innerHTML.match(/Hide/)) { link.innerHTML = "Show All"; link.removeEventListener('click', hideLabels, true); link.addEventListener('click', showLabels, true); } else { link.innerHTML = "Hide Some"; link.removeEventListener('click', showLabels, true); link.addEventListener('click', hideLabels, true); } } window.addEventListener('load', function() { GM_registerMenuCommand("Set list of Gmail labels to hide", setLabelList); addLink(); hideLabels(); }, true); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址