Skip to content

Commit

Permalink
Add placeholder callbacks to notifications (req. in Chrome < 42)
Browse files Browse the repository at this point in the history
  • Loading branch information
andryou committed Jun 3, 2016
1 parent 843c3e1 commit a7b12cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/scriptsafe.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
sendResponse({});
});
chrome.runtime.onUpdateAvailable.addListener(function (details) {
if (localStorage["updatemessagenotify"] == "true") chrome.notifications.create('updatenotify', {'type': 'basic', 'iconUrl': '../img/icon48.png', 'title': 'ScriptSafe - Update Ready', 'message': 'A new version ('+details.version+') of ScriptSafe is available! ScriptSafe will auto-update once you restart your browser.'});
if (localStorage["updatemessagenotify"] == "true") chrome.notifications.create('updatenotify', {'type': 'basic', 'iconUrl': '../img/icon48.png', 'title': 'ScriptSafe - Update Ready', 'message': 'A new version ('+details.version+') of ScriptSafe is available! ScriptSafe will auto-update once you restart your browser.'}, function(callback) { return true; });
});
// Debug Synced Items
/*
Expand Down Expand Up @@ -691,7 +691,7 @@ function freshSync(mode, force) {
if (chrome.extension.lastError){
alert(chrome.extension.lastError.message);
} else {
if (localStorage['syncnotify'] == 'true') chrome.notifications.create('syncnotify', {'type': 'basic', 'iconUrl': '../img/icon48.png', 'title': 'ScriptSafe - Settings Synced!', 'message': 'Your settings have been successfully synced!'});
if (localStorage['syncnotify'] == 'true') chrome.notifications.create('syncnotify', {'type': 'basic', 'iconUrl': '../img/icon48.png', 'title': 'ScriptSafe - Settings Synced!', 'message': 'Your settings have been successfully synced!'}, function(callback) { return true; } );
}
});
} else {
Expand All @@ -715,7 +715,7 @@ function importSyncHandle(mode) {
localStorage['syncenable'] = 'true';
localStorage['sync'] = 'true';
importSync(changes, 2);
if (localStorage['syncfromnotify'] == 'true') chrome.notifications.create('syncnotify', {'type': 'basic', 'iconUrl': '../img/icon48.png', 'title': 'ScriptSafe - Settings Downloaded!', 'message': 'The latest settings have been successfully downloaded!'});
if (localStorage['syncfromnotify'] == 'true') chrome.notifications.create('syncnotify', {'type': 'basic', 'iconUrl': '../img/icon48.png', 'title': 'ScriptSafe - Settings Downloaded!', 'message': 'The latest settings have been successfully downloaded!'}, function(callback) { return true; });
return true;
} else {
localStorage['syncenable'] = 'false';
Expand Down Expand Up @@ -851,7 +851,7 @@ if (storageapi) {
if (typeof changes['lastSync'] !== 'undefined') {
if (changes['lastSync'].newValue != localStorage['lastSync']) {
importSync(changes, 1);
if (localStorage['syncfromnotify'] == 'true') chrome.notifications.create('syncnotify', {'type': 'basic', 'iconUrl': '../img/icon48.png', 'title': 'ScriptSafe - Settings Downloaded!', 'message': 'The latest settings have been successfully downloaded!'});
if (localStorage['syncfromnotify'] == 'true') chrome.notifications.create('syncnotify', {'type': 'basic', 'iconUrl': '../img/icon48.png', 'title': 'ScriptSafe - Settings Downloaded!', 'message': 'The latest settings have been successfully downloaded!'}, function(callback) { return true; });
}
}
}
Expand Down

0 comments on commit a7b12cb

Please sign in to comment.