0

I'm developing Google Chrome Extension and I need to know when the tab is being reloaded or redirected to another page. chrome.tabs.onUpdated.addListener(function callback) let's me know when the tab is being redirected simply by checking if changeInfo.url is not undefined. But how can I catch when it's being current page on active tab is being reloaded? I tried to do it with changeInfo.status, but that's not working, since I'm making changes to page and this event onUpdated event is being fired then too.

Tommz
  • 3,393
  • 7
  • 32
  • 44
  • Does either of these help you ? http://stackoverflow.com/questions/8013429/jquery-detect-page-refresh http://api.jquery.com/unload/ – sinanspd Mar 20 '15 at 01:05
  • It does if I want to manage it with content scripts which is then messaging background script. But isn't there a more "direct" way? – Tommz Mar 20 '15 at 01:07
  • If you have a server side you might work something over HTTP requests as like "hey I have seen a request to this page before so it must be being reloaded" but I really dont believe it will be efficient or elegant at all. Beyond that this is all I have, I am sorry... But there might be another way of course – sinanspd Mar 20 '15 at 01:12
  • Nothing connected with server side :). – Tommz Mar 20 '15 at 01:13

0 Answers0