Move chrome-specific calls to chromium.js
// FREEBIE
This commit is contained in:
parent
b1afb79a14
commit
6dcff46e26
2 changed files with 27 additions and 20 deletions
|
@ -9,29 +9,11 @@
|
|||
};
|
||||
|
||||
console.log('background page reloaded');
|
||||
// register some chrome listeners
|
||||
if (chrome.notifications) {
|
||||
chrome.notifications.onClicked.addListener(function() {
|
||||
extension.notification.clear();
|
||||
Whisper.Notifications.onclick();
|
||||
});
|
||||
chrome.notifications.onButtonClicked.addListener(function() {
|
||||
extension.notification.clear();
|
||||
Whisper.Notifications.clear();
|
||||
getInboxCollection().each(function(model) {
|
||||
model.markRead();
|
||||
});
|
||||
});
|
||||
chrome.notifications.onClosed.addListener(function(id, byUser) {
|
||||
if (byUser) {
|
||||
Whisper.Notifications.clear();
|
||||
}
|
||||
});
|
||||
}
|
||||
extension.notification.init();
|
||||
|
||||
// Close and reopen existing windows
|
||||
var open = false;
|
||||
chrome.app.window.getAll().forEach(function(appWindow) {
|
||||
extension.windows.getAll().forEach(function(appWindow) {
|
||||
open = true;
|
||||
appWindow.close();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue