Manizest.json
{
"name":"MyExtension",
"version":"1.0",
"description":"MyExtension Description.",
"icons":{"128":"browseraction.png"},
"browser_action":
{
"default_icon":"icon.png",
"default":"Mi default title",
"popup":"popup.html"
},
"permissions":[
"http://*/*",
"tabs"
]
}
и это мой popup.html
<html>
<head>
<script type="text/javascript">
var address = "http://www.google.com";
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = handleStateChange;
xhr.open("GET", chrome.extension.getURL(address), true);//This dont work
//xhr.open("GET", chrome.extension.getURL('/popup1.html'), true);//thisWork
xhr.send();
function handleStateChange()
{
if (xhr.readyState == 4)
{
alert(xhr.responseText);
}
else
{
alert('Not Yet');
}
}
</script>
</head>
<body>
</body>
</html>
Я просто хочу отобразить HTML-код, с предупреждением я прочитал, http://code.google.com/chrome/extensions/xhr.html и другие ресурсы, но просто не работает Спасибо заранее