Hi all,
I'm making some changes to a google chrome extension I made and am having some trouble.
Heres my code on a content script page (removeAttr.js) :
chrome.extension.sendRequest({greeting: "whitelist"}, function(response) {
var whitelist = response.whitelist;
console.log(response.whitelist);//working
});
alert(whitelist);//alerts "undefined"
How do I acess the whitelist variable from outside the sendrequest() function?
Iv tried saving it to a window.var variable with no luck. Iv tried creating a div and assigning it's innerHTML as the whitelist variable and getting it later with no luck.
The fact that it's a chrome extension complicates things because i dont actually know if i can create elements from where the script is located.
Can anybody help me?
Max.