2

I have an extension that helps to manage some websites. When the current tab is loaded correctly, the extension starts to open a new tab but if the internet connection lost, it opens new tabs repeatedly.

How could I handle this situation? I want to reload the tab after 60 seconds. If the requested URL wasn't response without any problem.

myalcin81
  • 187
  • 1
  • 13
  • 1
    Welcome to StackOverflow, please provide your code and let us know what you have tried so far so we can help you properly. In regards to your question, my understanding is you are trying to get the status of a web page (in a Tab) if it was fully loaded or not then a simple way is the following `chrome.tabs.onUpdated.addListener(function (tabId , info) { if (info.status === 'complete') { // your code ... } });` -- https://stackoverflow.com/questions/2149917/chrome-extensions-how-to-know-when-a-tab-has-finished-loading-from-the-backgr – Ali Dec 04 '18 at 01:19
  • 1
    Use chrome.webNavigation.onErrorOccurred, see the documentation for details. – wOxxOm Dec 04 '18 at 04:47
  • I used to chrome.WebNavigation.onErrorOccurred and it works thank you. But using it a little bit hard because it triggered a lot of unnecessary exceptions that you want to listen. – myalcin81 May 11 '20 at 16:09

0 Answers0