I am using some AJAX calls in my popup on a button click:
var xhr = new XMLHttpRequest();
xhr.open("GET", yourURL, true);
xhr.send();
chrome.tabs.create({url:<some url here>});
The problem is that the popup closes as soon as the button is clicked, and I think thats why the ajax calls are not completing.
Is this a common issue? What can I do to make sure that the ajax calls have sufficient time to complete?
This is what a background page was made for. Move your code to a background page into some
myFunction(), then call it from a popup: