Add support for chrome browsers

This commit is contained in:
2021-07-14 22:01:41 +02:00
parent 96063abc3a
commit 34327b8775
3 changed files with 12 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
function saveOptions(e) {
e.preventDefault();
browser.storage.local.set({
chrome.storage.local.set({
local: document.querySelector("#local").value,
test: document.querySelector("#test").value,
prod: document.querySelector("#prod").value,
@@ -14,12 +14,7 @@ function restoreOptions() {
document.querySelector("#prod").value = restoredSettings.prod || "";
}
function onError(error) {
console.log(`Error: ${error}`);
}
const gettingStoredSettings = browser.storage.local.get();
gettingStoredSettings.then(updateUI, onError);
chrome.storage.local.get(null, updateUI);
}
document.addEventListener("DOMContentLoaded", restoreOptions);