I try to save datas from my chrome extension :
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
chrome.storage.sync.set(request, function() {
chrome.storage.sync.get(null, function(datas) {
console.log(datas);
console.log("background");
sendResponse(datas);
})
});
}
);
Each time I'm receiving a message, I store this message, and I send all saved item as a response.
In this code, in the console, background
is displayed but datas is empty (Nothing in the console)
When I console.log(request)
my json objet is ok.
In this code, why datas is empty ?
Thanks