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-02-07 23:38:33 +00:00
|
|
|
browser.storage.local.get('days', function(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);
|