HistoryCleaner/options.js
2017-03-12 10:59:11 -04:00

11 lines
420 B
JavaScript

function saveOptions(e) {
browser.storage.local.set({days: document.querySelector("#days").value});
e.preventDefault();
}
function restoreOptions() {
browser.storage.local.get('days').then((res) => {
document.querySelector("#days").value = res.days || 0;
});
}
document.addEventListener('DOMContentLoaded', restoreOptions);
document.querySelector("form").addEventListener("submit", saveOptions);