Fixup dir structure
This commit is contained in:
parent
4595ad0fc4
commit
eec4c66ef6
20 changed files with 53 additions and 49 deletions
14
js/background.js
Normal file
14
js/background.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
if (!localStorage.getItem('first_install_ran')) {
|
||||
localStorage.setItem('first_install_ran', 1);
|
||||
chrome.tabs.create({url: "options.html"});
|
||||
} else {
|
||||
if (isRegistrationDone()) {
|
||||
subscribeToPush(function(message) {
|
||||
console.log("Got message from " + message.source + ": \"" + getString(message.message));
|
||||
var newUnreadCount = storage.getUnencrypted("unreadCount") + 1;
|
||||
storage.putUnencrypted("unreadCount", newUnreadCount);
|
||||
chrome.browserAction.setBadgeText({text: newUnreadCount + ""});
|
||||
storeMessage(message);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue