Add popup that allows modifying the config url

This commit is contained in:
Dave Gallant
2023-04-08 00:04:33 -04:00
parent 5a58a92460
commit c72db40f7d
13 changed files with 262 additions and 31 deletions

View File

@@ -0,0 +1,25 @@
const inputField = document.getElementById("input-field");
const saveButton = document.getElementById("save-button");
const resetButton = document.getElementById("reset-button");
const defaultConfig =
"https://raw.githubusercontent.com/davegallant/rfd-redirect-stripper/main/redirects.json";
chrome.storage.local.get("config").then((result) => {
const value = result.config;
if (value) {
inputField.value = value;
}
});
saveButton.addEventListener("click", () => {
const value = inputField.value;
chrome.storage.local.set({ config: value });
updateRedirects();
});
resetButton.addEventListener("click", () => {
setDefaultConfig();
inputField.value = defaultConfig;
updateRedirects();
});