diff --git a/manifest.json b/manifest.json index 3836a7c32..2cdcbde49 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "manifest_version": 2, - "name": "IPFS Gateway Redirect 2", + "name": "IPFS Gateway Redirect WX", "version" : "2.0.0", "description": "Access IPFS resources via custom HTTP2IPFS gateway", @@ -23,6 +23,10 @@ "default_popup": "popup/button-menu.html" }, + "options_ui": { + "page": "settings/options.html" + }, + "web_accessible_resources": [ "data/linkify-demo.html", "icons/ipfs-logo-on.svg", diff --git a/settings/options.html b/settings/options.html new file mode 100644 index 000000000..cd7b51817 --- /dev/null +++ b/settings/options.html @@ -0,0 +1,22 @@ + + + + + + + + + +
+
+ Options +
+ +
+
+ + + + + + diff --git a/settings/options.js b/settings/options.js new file mode 100644 index 000000000..eab589f05 --- /dev/null +++ b/settings/options.js @@ -0,0 +1,14 @@ +function saveOptions(e) { + chrome.storage.local.set({ + publicGateways: document.querySelector("#publicGateways").value + }); +} + +function restoreOptions() { + chrome.storage.local.get("publicGateways", (res) => { + document.querySelector("#publicGateways").value = res.publicGateways || "ipfs.io gateway.ipfs.io ipfs.pics"; + }); +} + +document.addEventListener("DOMContentLoaded", restoreOptions); +document.querySelector("form").addEventListener("submit", saveOptions);