

var resource;
var locale;

chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
	console.log(request);
    document.getElementById("prova").innerHTML = request.name;
});

window.addEventListener("load",function(){
	console.log("init");
	chrome.storage.local.get(["name","locale"],function(data){
		resource = data.name;
		locale = data.locale;
		document.getElementById("resource").innerHTML = resource;
		document.getElementById("locale").innerHTML = locale;
	});

});