Answer the question
In order to leave comments, you need to log in
How to get chrome storage values in content script?
In popup.js I store data in chrome storage
var mail = document.getElementById("mail").value;
chrome.storage.local.set({email: mail}, function() {
console.log('Value is ' + mail);
});
chrome.storage.local.get(['mail'], function(result) {
console.log('Value currently is ' + result.mail);
});
Answer the question
In order to leave comments, you need to log in
If you save content like this:
Then I will tell you that it is not saved like this.
Need like this:
var mail = document.getElementById("mail").value;
chrome.storage.local.set({mail: document.getElementById("mail").value}, function() {
console.log('Сохранено' );
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question