First steps into JavaScript and the Chrome extension world. I followed the tutorial for a simple extension at Chrome guide. Building on it I want to change the code to display the avatars of the users from Stack Overflow's users page.
I am trying to determine why an abort event is being fired and why the XMLHttpRequest
object is not populate with the response.
My manifest.json
is:
{
/*snip*/
"manifest_version": 2,
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [
"http://stackoverflow.com/users",
"http://stackoverflow.com/users/*",
"notifications"
],
"web_accessible_resources": [
"icon.png"
]
}
My popup.html
:
<script src="popup.js"></script>
And my Javascript file is:
var req = new XMLHttpRequest();
req.open(
"GET",
"http://stackoverflow.com/users",
true);
window.addEventListener('loadend', showPhotos);
req.addEventListener("error", errorMsg, false);
req.addEventListener("abort", cancelMsg, false);
req.send(null);
As I mentioned the cancelMsg
is being run and I am trying to understand why. My Chrome version is 23.