I'm trying to save the email and the password of the user. What I'm missing here?
Here's my HTML:
<input type="text" name="email" id="email" placeholder="E-mail" />
<input type="password" name="password" id="password" placeholder="Password" />
<button id="import">Import!</button>
<script type="text/javascript" src="popup.js"></script>
Here's my JavaScript:
chrome.storage.local.get('email', function(result) {
document.getElementById("email").value = result.value;
});
chrome.storage.local.get('password', function(result) {
document.getElementById("password").value = result.value;
});
document.getElementById("import").addEventListener("click", function() {
chrome.storage.local.set({'email': document.getElementById("email").value});
chrome.storage.local.set({'password': document.getElementById("password").value});
}
Strangly, when I refresh the page, the values are not being kept.