Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Title patch for Inbox by Gmail™
// ==UserScript==
// @name Title patch for Inbox by Gmail™
// @namespace com.github.harai
// @description Count unread messages and display it as the page's title.
// @include https://inbox.google.com/*
// @version 1
// @grant none
// ==/UserScript==
setInterval(function() {
if (window.parent !== window) {
return;
}
var n = document.getElementsByClassName('ss').length;
if (!document.title) {
return;
}
var newTitle = document.title.replace(/^.*?Inbox/, (n ? '(' + n + ') ' : '') + 'Inbox');
if (newTitle === document.title) {
return;
}
document.title = newTitle;
}, 1000);
@harai

This comment has been minimized.

Copy link
Owner Author

commented Nov 24, 2015

This UserScript enables Firefox and Chrome to show notification if the tab is pinned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.