chrome.windows.onFocusChanged.addListener不会触发标签切换 [英] chrome.windows.onFocusChanged.addListener not firing on tab switching
本文介绍了chrome.windows.onFocusChanged.addListener不会触发标签切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
但切换标签页时出现问题(使用alt + tab)window.chrome.onFocusChanged
我的代码:
chrome.windows .onFocusChanged.addListener(function(windowId){
console.log(focus change,windowId);
});
有没有解决这个或者...这是个bug?
解决方案
这是一个已经发布在 Chrome Bug Tracker 。不幸的是,它几乎没有受到任何关注。没有消息,如果它将在不久的将来在里程碑迭代中修复。
I am trying to fetch all events (maximized, maximize etc). I have a suitable code for this from this link How to Detect Window On Minimize/Maximize Event in Chrome Extension?.
But the problem when switch tab (using alt+tab) window.chrome.onFocusChanged listener is not firing.
My code :
chrome.windows.onFocusChanged.addListener(function(windowId) {
console.log("focus change", windowId);
});
Is there a solution for this or... it is a bug?
解决方案
This is a confirmed bug which was already posted at the Chrome Bug Tracker back in 2014. Unfortunately, it received little to no attention. No news if it will be fixed in milestone iterations in the near future either.
这篇关于chrome.windows.onFocusChanged.addListener不会触发标签切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文