Last active
November 7, 2024 01:50
-
-
Save solidgoldpig/c2561e13e2982ab0a98d3cd1fbf3cb74 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/userscripts/sgp-mail | |
// @version 0.1 | |
// @description Make Gmail more bearable | |
// @author [email protected] | |
// @match https://mail.google.com/* | |
// @grant none | |
// ==/UserScript== | |
/* jshint ignore:start */ | |
(function () { | |
'use strict' | |
var labelsToIgnore = [ | |
'csslayout', | |
'cwjobs', | |
'jobs', | |
'node-js', | |
'wsg-announce', | |
'w3c-training', | |
'logcheck', | |
'[email protected]' | |
] | |
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() | |
} | |
const intervalID = setInterval(function () { | |
if (window.Shortcut) { | |
window.Shortcut.add('Meta+Shift+u', showUnread) | |
clearInterval(intervalID) | |
} | |
}, 10) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment