我正在尝试创建一个 chrome 扩展程序,perkytweets
该扩展程序在弹出的扩展程序中显示带有井号标签的推文,但没有显示任何内容。
这是 manifest.json 代码
{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,
"description": "The first extension that I made.",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
}
}
这是 popup.html 代码
<html>
<head>
<title>Getting Started Extension's Popup</title>
<style>
body {
min-width:357px;
overflow-x:hidden;
}
img {
margin:5px;
border:2px solid black;
vertical-align:middle;
width:75px;
height:75px;
}
</style>
<script src="script.js"></script>
</head>
<body>
</body>
</html>
这是 script.js 代码
var req = new XMLHttpRequest();
req.open(
"GET",
"http://search.twitter.com/search.atom?q=perkytweets",
true);
req.onload = showTweets;
req.send(null);
function showTweets()
{
document.body.appendChild(req.responseXML);
}