I am trying to get a string of values from a background page to my content script in a Google Chrome extension I am making.
The problem I am encountering is that when I try to get the value to the content script, it doesn't go. Here is the code
var list1 = "";
chrome.extension.sendRequest({action: 'list'}, function(response) {
list1 = response.data;
alert("hey from inside:" + list1 +":"+response.data);
});
alert(list1);
The first alert that comes up shows properly saying "hey from inside" and the list I want the content script to have. But then, when I try to alert the variable that I stored it in from outside of that request, it doesn't show the list.
Please help