Add updating of window title on launch
The window title show the number of global unread messages when the inbox window launches.
This commit is contained in:
parent
156c7c3b3d
commit
86edcc06c2
1 changed files with 4 additions and 2 deletions
|
@ -43,6 +43,10 @@
|
||||||
appWindow = windowInfo;
|
appWindow = windowInfo;
|
||||||
inboxWindowId = appWindow.id;
|
inboxWindowId = appWindow.id;
|
||||||
|
|
||||||
|
appWindow.contentWindow.addEventListener('load', function() {
|
||||||
|
setUnreadCount(storage.get("unreadCount", 0));
|
||||||
|
});
|
||||||
|
|
||||||
appWindow.onClosed.addListener(function () {
|
appWindow.onClosed.addListener(function () {
|
||||||
inboxOpened = false;
|
inboxOpened = false;
|
||||||
appWindow = null;
|
appWindow = null;
|
||||||
|
@ -75,13 +79,11 @@
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
extension.navigator.setBadgeText(count);
|
extension.navigator.setBadgeText(count);
|
||||||
if (inboxOpened === true) {
|
if (inboxOpened === true) {
|
||||||
var appWindow = chrome.app.window.get(inboxWindowId);
|
|
||||||
appWindow.contentWindow.document.title = "Signal (" + count + ")";
|
appWindow.contentWindow.document.title = "Signal (" + count + ")";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
extension.navigator.setBadgeText("");
|
extension.navigator.setBadgeText("");
|
||||||
if (inboxOpened === true) {
|
if (inboxOpened === true) {
|
||||||
var appWindow = chrome.app.window.get(inboxWindowId);
|
|
||||||
appWindow.contentWindow.document.title = "Signal";
|
appWindow.contentWindow.document.title = "Signal";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue