chrome.tabs.onUpdated.addListener在从缓存中检索页面时未触发 [英] chrome.tabs.onUpdated.addListener not fired when page is retrieved from cache

查看:133
本文介绍了chrome.tabs.onUpdated.addListener在从缓存中检索页面时未触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下监听器:

I have the following listener:

chrome.tabs.onUpdated.addListener(function(tabId, change, tab) {
  if (change.status == "complete") {
    // Do something
  }
});

将我的铬浏览器从16.x升级到17.x后,我注意到了这一点听众并不总是被解雇。例如,当它看起来像从缓存中检索页面(加载非常快)时,它不会触发。然后,如果我重新加载页面,它会像往常一样被解雇。

After upgrading my chromium browser from 16.x to 17.x I've paid an attention that this listener is not always fired. For example, when it seems like the page is retrieved from cache (loads very quickly) it doesn't fire. Then, if I reload the page, it's fired as usual.

这个API方法在17.x中有什么改变吗?

Are there any changes made to this API method in 17.x?

谢谢!

Thanks!

推荐答案

我碰到过同样的错误。与此同时,我使用 tabs.onActiveChanged 事件,当焦点从即时栏切换回标签时,似乎会触发此事件。我不确定它是否是一个特别强大的解决方案,但到目前为止它已经为我工作。

I've come across the same bug. In the meantime, I'm using the tabs.onActiveChanged event, which seems to fire when focus switches from the instant bar back to the tab. I'm not sure if it's a particularly robust solution, but so far it is working for me.

这篇关于chrome.tabs.onUpdated.addListener在从缓存中检索页面时未触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆