chrome.windows.onFocusChanged.addListener not firing on tab switching

寵の児 提交于 2019-12-19 19:15:03

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/36009207/chrome-windows-onfocuschanged-addlistener-not-firing-on-tab-switching

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