From c2b3632d9fc6c523e6d37e1bfe80c47a2b6e4aeb Mon Sep 17 00:00:00 2001 From: Joe Jarvis Date: Sun, 12 Mar 2017 10:59:11 -0400 Subject: [PATCH] Cleaned up code. --- .gitignore | 2 ++ background.js | 6 +++--- manifest.json | 5 +++++ options.js | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4a2f00 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.jshintrc +*.swp diff --git a/background.js b/background.js index 78108ff..ad48312 100644 --- a/background.js +++ b/background.js @@ -1,8 +1,8 @@ -browser.idle.onStateChanged.addListener(function(state) { +browser.idle.onStateChanged.addListener((state) => { if (state == 'idle') { - browser.storage.local.get('days', function(res) { + browser.storage.local.get('days').then((res) => { var days = res.days || 0; - if (days != 0) { + if (days !== 0) { var end = new Date(); end.setHours(0); end.setMinutes(0); diff --git a/manifest.json b/manifest.json index c570dfe..b22cfc9 100644 --- a/manifest.json +++ b/manifest.json @@ -3,6 +3,11 @@ "name": "History Cleaner", "version": "1.1", "description": "Deletes history older than a specified amount of days.", + "applications": { + "gecko": { + "id": "{a138007c-5ff6-4d10-83d9-0afaf0efbe5e}" + } + }, "icons": { "48": "icons/icon-48.png", "96": "icons/icon-96.png" diff --git a/options.js b/options.js index 7e0fd63..645b339 100644 --- a/options.js +++ b/options.js @@ -3,7 +3,7 @@ function saveOptions(e) { e.preventDefault(); } function restoreOptions() { - browser.storage.local.get('days', function(res) { + browser.storage.local.get('days').then((res) => { document.querySelector("#days").value = res.days || 0; }); }