chrome.windows.onFocusChanged.addListener不会触发标签切换 [英] chrome.windows.onFocusChanged.addListener not firing on tab switching

查看:490
本文介绍了chrome.windows.onFocusChanged.addListener不会触发标签切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图获取所有事件(最大化,最大化等)。我有一个合适的代码,从这个链接如何在Chrome扩展中最小化/最大化事件时检测窗口?



但切换标签页时出现问题(使用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屋!

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