]> git.wh0rd.org - chrome-ext/clearhistory-advance-fork.git/blobdiff - javascript/options.js
add an option to run silently -- no notifications at all
[chrome-ext/clearhistory-advance-fork.git] / javascript / options.js
index bd3a2275c1b341372d9bc3f7f7d0b61556d7fb42..c4ffda4634b32cc5255b86a395d4df369a25bbf1 100644 (file)
@@ -40,7 +40,7 @@ function init() {
 
   // Load or set localStorage data
   var settings = [
-    'timeStart', 'time', 'prompt', 'cookies', 'downloads', 'autoclear',
+    'timeStart', 'time', 'prompt', 'cookies', 'downloads', 'autoclear', 'notify',
   ];
   chrome.storage.sync.get(settings, function(s) {
     var timeStart = s.timeStart || CONSTANTS.YES;
@@ -49,6 +49,7 @@ function init() {
     var clearCookies = s.cookies || CONSTANTS.NO;
     var clearDownloads = s.downloads || CONSTANTS.NO;
     var autoClear = s.autoclear || CONSTANTS.NO;
+    var notify = s.notify || CONSTANTS.YES;
 
     $('input[name=timeStart][value="' + timeStart + '"]')[0].checked = true;
     $('input[name=time][value="' + time + '"]')[0].checked = true;
@@ -56,6 +57,7 @@ function init() {
     $('input[name=cookies]')[0].checked = (clearCookies === CONSTANTS.YES);
     $('input[name=downloads]')[0].checked = (clearDownloads === CONSTANTS.YES);
     $('input[name=autoclear]')[0].checked = (autoClear === CONSTANTS.YES);
+    $('input[name=notify]')[0].checked = (notify === CONSTANTS.YES);
   });
 }