0
私は電子メールとユーザーのパスワードを保存しようとしています。ここで私は何が欠けているのですか?ここでchrome.storage.local.set /は正しく動作しませんか?
は私の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>
は、ここに私のJavaScriptのだ:
Stranglychrome.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});
}
、私はページを更新すると、値が保存されていません。
[ここで見る](https://stackoverflow.com/questions/13872542/chrome-chrome-storage-local-get-and-set)ここでは任意のヘルプ? – Constantine
'console.log(result)'を試してみたところ、 'chrome.storage.local.get'は実際には' value'のないオブジェクトを返しています。私は答えを投稿します。 –