Interface and basic functionality.
Just learning how to make a basic extension. Creating an interface and setting up some basic plumbing.
This commit is contained in:
@@ -1 +1,21 @@
|
||||
console.log("Hello World!", browser);
|
||||
async function savePrivateKey(event) {
|
||||
event.preventDefault();
|
||||
let privKey = document.getElementById('priv-key');
|
||||
browser.storage.local.set({ "priv-key": privKey.value });
|
||||
}
|
||||
|
||||
async function getPrivateKey() {
|
||||
let key = await browser.storage.local.get("priv-key");
|
||||
return key["priv-key"];
|
||||
}
|
||||
|
||||
async function setPrivKeyInput() {
|
||||
let privKey = await getPrivateKey();
|
||||
|
||||
if (privKey) {
|
||||
document.getElementById("priv-key").value = privKey;
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("priv-key-form").addEventListener("submit", savePrivateKey);
|
||||
setPrivKeyInput();
|
||||
|
||||
Reference in New Issue
Block a user