Made some changes to options script
This commit is contained in:
parent
6a3c6e74c5
commit
d8c62d8861
1 changed files with 5 additions and 10 deletions
15
options.js
15
options.js
|
@ -1,16 +1,11 @@
|
|||
function saveOptions(e) {
|
||||
browser.storage.local.set({
|
||||
days: document.querySelector("#days").value
|
||||
});
|
||||
e.preventDefault();
|
||||
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';
|
||||
});
|
||||
browser.storage.local.get('days', function(res) {
|
||||
document.querySelector("#days").value = res.days || '0';
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', restoreOptions);
|
||||
document.querySelector("form").addEventListener("submit", saveOptions);
|
||||
|
|
Loading…
Reference in a new issue