Now, I’m writing
function tabStatusOnChange(tabId, changeInfo)
{
if(changeInfo.status == "complete")
chrome.tabs.executeScript(null, {file:"oneuniverse.js"});
}
chrome.tabs.onUpdated.addListener(tabStatusOnChange);
But it’s not working for ajax page and gmail , too. How to write for ajax status complete
You cannot use chrome.tabs.onUpdated for XHR because it only get fires when a tab is updated. When you send an XHR request, the tab is not updated (that is the whole point of “AJAX”)
The only way to know if the AJAX call finished, is by overriding it. You can override the AJAX request (which uses XmlHTTPRequest), something like this:
An XMLHttpRequest could be Synchronous or Asynchronous, so you have to take into consideration both. When I meant
customImplementation, it means you will use the same implementation but you will add hooks in some places (such as an Adapter Pattern).