How to identify a tab is reloading, I mean actual page reload

荒凉一梦 提交于 2019-12-13 01:43:49

问题


How to identify a tab is reloading, I mean actual page reload? I see chrome.tabs.onUpdated event, but for this event status is 'loading' even in case of AJAX calls from a webpage. How can I detect a page is getting reloaded ?


回答1:


You are right, looks like not possible to recognize AJAX and page reload calls. As workaround you could listen for onunload event for tab webpage. You probably need to check if tabid and url were not changed after that.

But do you really need to know if page reloaded?



来源:https://stackoverflow.com/questions/23333771/how-to-identify-a-tab-is-reloading-i-mean-actual-page-reload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!