HistoryCleaner/options.js

12 lines
420 B
JavaScript
Raw Normal View History

2017-02-07 23:31:13 +00:00
function saveOptions(e) {
2017-02-07 23:38:33 +00:00
browser.storage.local.set({days: document.querySelector("#days").value});
e.preventDefault();
2017-02-07 23:31:13 +00:00
}
function restoreOptions() {
2017-03-12 14:59:11 +00:00
browser.storage.local.get('days').then((res) => {
2017-02-08 22:51:07 +00:00
document.querySelector("#days").value = res.days || 0;
2017-02-07 23:38:33 +00:00
});
2017-02-07 23:31:13 +00:00
}
document.addEventListener('DOMContentLoaded', restoreOptions);
document.querySelector("form").addEventListener("submit", saveOptions);