Files
SysTray-X/webext/options.js

24 lines
582 B
JavaScript
Raw Normal View History

2020-01-05 00:54:40 +01:00
function saveOptions(e) {
e.preventDefault();
browser.storage.sync.set({
// color: document.querySelector("#color").value
});
}
function restoreOptions() {
function setCurrentChoice(result) {
// document.querySelector("#color").value = result.color || "blue";
}
function onError(error) {
console.log(`Error: ${error}`);
}
var getting = browser.storage.sync.get("color");
getting.then(setCurrentChoice, onError);
}
document.addEventListener("DOMContentLoaded", restoreOptions);
document.querySelector("form").addEventListener("submit", saveOptions);