Created
January 20, 2021 22:59
-
-
Save Ramko9999/e5aa66d227caea26d18cd3f79b8bd16f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const onHandleSubmit = () => { | |
const newMessage = document.getElementById("message").value; | |
chrome.storage.sync.set({message: newMessage}, () => { | |
console.log("Finished Setting!"); | |
}); | |
} | |
const setupHandlers = () => { | |
const submitButton = document.getElementById("submit"); | |
submitButton.onclick = onHandleSubmit; | |
} | |
chrome.storage.sync.get(["message"], ({message}) => { | |
const messageInput = document.getElementById("message"); | |
messageInput.value = message; | |
setupHandlers(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment