Last active
April 14, 2016 18:19
-
-
Save solidgoldpig/c2561e13e2982ab0a98d3cd1fbf3cb74 to your computer and use it in GitHub Desktop.
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 SGP Mail | |
// @namespace http://solidgoldpig.com/tampermonkey/sgp-mail | |
// @version 0.1 | |
// @description Make Gmail more bearable | |
// @author tampermonkey@alex.solidgoldpig.com | |
// @match https://mail.google.com/* | |
// @grant none | |
// ==/UserScript== | |
/* jshint ignore:start */ | |
(function () { | |
'use strict' | |
var labelsToIgnore = [ | |
'cwjobs', | |
'node-js', | |
'wsg-announce', | |
'w3c-training', | |
'logcheck', | |
'tzutzik@cloudband.com' | |
] | |
var searchList = `label:unread ${labelsToIgnore.map((l) => '-label:' + l).join(' ')}` | |
function showUnread () { | |
document.querySelector('input[aria-label^="Search"]').value = searchList | |
document.querySelector('button[aria-label^="Search"]').click() | |
} | |
if (window.Shortcut) { | |
window.Shortcut.add('Meta+Shift+u', showUnread) | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment