only trigger notification on major v change
parent
05f06075b2
commit
4fc1d3ef53
|
@ -37,6 +37,11 @@ chrome.app.runtime.onLaunched.addListener(function() {
|
|||
|
||||
chrome.runtime.onInstalled.addListener(function(details) {
|
||||
if (details.reason == 'update') {
|
||||
var previousVersionArr = details.previousVersion.split('.');
|
||||
var currentVersionArr = chrome.runtime.getManifest().version.split('.');
|
||||
|
||||
// only fire up notification sequence when one of the major version numbers changed
|
||||
if (currentVersionArr[0] != previousVersionArr[0] || currentVersionArr[1] != previousVersionArr[1]) {
|
||||
chrome.storage.local.get('update_notify', function(result) {
|
||||
if (typeof result.update_notify === 'undefined' || result.update_notify) {
|
||||
var manifest = chrome.runtime.getManifest();
|
||||
|
@ -55,6 +60,7 @@ chrome.runtime.onInstalled.addListener(function(details) {
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
chrome.notifications.onButtonClicked.addListener(function(notificationId, buttonIndex) {
|
||||
|
|
Loading…
Reference in New Issue