Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
An updated Fluidapp Userscript for Gmail
// use for patterns:
// *gmail.com*
// *mail.google.com*
// *google.com*mail*
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 15000);
function updateDockBadge() {
var inboxLink = document.querySelector('a[title^="Inbox"]');
var regex = /\s*Inbox\s*\((\d+)\)[^\d]*/;
var res = inboxLink.title.match(regex);
if (res && res.length > 1) {
var newBadge = res[1];
window.fluid.dockBadge = newBadge;
} else {
regex = /^Inbox$/;
if(regex.test(inboxLink.title)){
window.fluid.dockBadge = '';
}
}
}
@tordans

This comment has been minimized.

Copy link

@tordans tordans commented Feb 12, 2017

Could not get this one working. This works for me: https://gist.github.com/tordans/85cbaa856b93b52e9a1465004569218e

@ssetti

This comment has been minimized.

Copy link

@ssetti ssetti commented Feb 26, 2019

@BDO811

This comment has been minimized.

Copy link

@BDO811 BDO811 commented Sep 15, 2019

I updated to macOS Catalina beta and this stopped working. Any ideas?

@jakebellacera

This comment has been minimized.

Copy link
Owner Author

@jakebellacera jakebellacera commented Sep 16, 2019

@BDO811 Perhaps it's a bug with Catalina? I don't use FluidApp anymore unfortunately :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment