-
-
Save tordans/85cbaa856b93b52e9a1465004569218e to your computer and use it in GitHub Desktop.
Gmail Fluid App Userscript
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
// use for patterns: | |
// *gmail.com* | |
// *mail.google.com* | |
// *google.com*mail* | |
// Initialize Badge so we see that this works | |
window.fluid.dockBadge = 99; | |
// Updater | |
setTimeout(updateDockBadge, 1000); | |
setTimeout(updateDockBadge, 3000); | |
setInterval(updateDockBadge, 5000); | |
function updateDockBadge() { | |
// Extract unread message count from title and set dockBadge | |
// There is no "Inbox" in this regex to work around different gmail-languages. | |
var regex = /\s*\((\d+)\)[^\d]*/; | |
window.fluid.dockBadge = document.querySelector('title').textContent.match(regex)[1]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FYI, this is no longer necessary with Version 2+ of Fluid.