Cleaned up code.

This commit is contained in:
Joe Jarvis 2017-03-12 10:59:11 -04:00
parent 9c3176eba1
commit c2b3632d9f
4 changed files with 11 additions and 4 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.jshintrc
*.swp

View file

@ -1,8 +1,8 @@
browser.idle.onStateChanged.addListener(function(state) { browser.idle.onStateChanged.addListener((state) => {
if (state == 'idle') { if (state == 'idle') {
browser.storage.local.get('days', function(res) { browser.storage.local.get('days').then((res) => {
var days = res.days || 0; var days = res.days || 0;
if (days != 0) { if (days !== 0) {
var end = new Date(); var end = new Date();
end.setHours(0); end.setHours(0);
end.setMinutes(0); end.setMinutes(0);

View file

@ -3,6 +3,11 @@
"name": "History Cleaner", "name": "History Cleaner",
"version": "1.1", "version": "1.1",
"description": "Deletes history older than a specified amount of days.", "description": "Deletes history older than a specified amount of days.",
"applications": {
"gecko": {
"id": "{a138007c-5ff6-4d10-83d9-0afaf0efbe5e}"
}
},
"icons": { "icons": {
"48": "icons/icon-48.png", "48": "icons/icon-48.png",
"96": "icons/icon-96.png" "96": "icons/icon-96.png"

View file

@ -3,7 +3,7 @@ function saveOptions(e) {
e.preventDefault(); e.preventDefault();
} }
function restoreOptions() { function restoreOptions() {
browser.storage.local.get('days', function(res) { browser.storage.local.get('days').then((res) => {
document.querySelector("#days").value = res.days || 0; document.querySelector("#days").value = res.days || 0;
}); });
} }