HistoryCleaner/options.js

17 lines
453 B
JavaScript
Raw Normal View History

2017-02-07 23:31:13 +00:00
function saveOptions(e) {
browser.storage.local.set({
days: document.querySelector("#days").value
});
e.preventDefault();
}
function restoreOptions() {
var gettingItem = browser.storage.local.get('days');
gettingItem.then((res) => {
document.querySelector("#days").value = res.days || '0';
});
}
document.addEventListener('DOMContentLoaded', restoreOptions);
document.querySelector("form").addEventListener("submit", saveOptions);