Skip to content
/ textern Public
forked from jlebon/textern

Commit

Permalink
feat(webext): save/restore the flag for killing editors
Browse files Browse the repository at this point in the history
Refs: jlebon#44.
  • Loading branch information
phdru committed Mar 14, 2023
1 parent c87d915 commit fabc721
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion webex/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ function saveOptions(e) {
editor: document.querySelector("#editor").value,
shortcut: document.querySelector("#shortcut").value,
extension: document.querySelector("#extension").value,
backupdir: document.querySelector("#backupdir").value
backupdir: document.querySelector("#backupdir").value,
kill_editors_allow: document.querySelector("#kill_editors_allow").checked,
});
document.querySelector("#saved").innerHTML = '\u2713';
}
Expand All @@ -43,6 +44,10 @@ function restoreOptions() {
browser.storage.local.get("backupdir").then(result => {
document.querySelector("#backupdir").value = result.backupdir || "";
}, onError);

browser.storage.local.get("kill_editors_allow").then(result => {
document.querySelector("#kill_editors_allow").checked = result.kill_editors_allow || false;
}, onError);
}

document.addEventListener("DOMContentLoaded", restoreOptions);
Expand Down

0 comments on commit fabc721

Please sign in to comment.