utilizing notifications API
parent
3d58387f62
commit
8ee079389a
|
@ -1,4 +1,4 @@
|
|||
chrome.app.runtime.onLaunched.addListener(function() {
|
||||
function start_app() {
|
||||
chrome.app.window.create('main.html', {
|
||||
frame: 'chrome',
|
||||
id: 'main-window',
|
||||
|
@ -17,4 +17,32 @@ chrome.app.runtime.onLaunched.addListener(function() {
|
|||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
chrome.app.runtime.onLaunched.addListener(function() {
|
||||
start_app();
|
||||
});
|
||||
|
||||
chrome.runtime.onInstalled.addListener(function(details) {
|
||||
if (details.reason == 'update') {
|
||||
var manifest = chrome.runtime.getManifest();
|
||||
var options = {
|
||||
priority: 0,
|
||||
type: 'basic',
|
||||
title: 'Baseflight Configurator Update',
|
||||
message: 'Application just updated to version: ' + manifest.version,
|
||||
iconUrl: '/images/icon_128.png',
|
||||
buttons: [{'title': 'Click this button to start the application'}]
|
||||
};
|
||||
|
||||
chrome.notifications.create('baseflight_update', options, function(notificationId) {
|
||||
// empty
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
chrome.notifications.onButtonClicked.addListener(function(notificationId, buttonIndex) {
|
||||
if (notificationId == 'baseflight_update') {
|
||||
start_app();
|
||||
}
|
||||
});
|
|
@ -18,7 +18,8 @@
|
|||
"storage",
|
||||
"fileSystem",
|
||||
"fileSystem.write",
|
||||
"clipboardWrite"
|
||||
"clipboardWrite",
|
||||
"notifications"
|
||||
],
|
||||
|
||||
"icons": {
|
||||
|
|
Loading…
Reference in New Issue