Chrome popup and ajax background extension

I have a requirement that background.html is constantly updated every 10 minutes, and when I click on the popup, it should immediately activate the background refresh and display the result in the popup.

I have a background update using ajax, and I have a popup that creates a background for an immediate update using ajax. However, I was fixated on how to display the last result in a popup ... how do I know when the ajax background call is completed and show the last result in a popup?

thank

+5
source share
1 answer

, , , .

# 2, , Script.

var popups = chrome.extension.getViews({type: "popup"});
if (popups.length != 0) {
  var popup = popups[0];
  popup.doSomething();
}

, .

+13

All Articles