如何使Chrome扩展程序的窗口在任务栏中闪烁? [英] How do I make a Chrome extension's window blink in the taskbar?

查看:336
本文介绍了如何使Chrome扩展程序的窗口在任务栏中闪烁?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到有些应用程序可以使用chrome扩展程序使任务栏中的窗口闪烁?类似于Chrome在下载内容时显示绿色进度条的方式,其他窗口也会闪烁橙色以引起您的注意.反正有一个Chrome扩展程序可以做到这一点吗?

I've noticed there are some applications that can make the window in the taskbar blink using a chrome extension? Similar to how chrome will show a green progress bar when downloading something, other windows will blink orange to get your attention. Is there anyway to get a chrome extension to do this?

推荐答案

是的,可以使用

Yes, it's possible with the windows API:

drawAttention

如果为true,则使窗口以一种将用户的注意力吸引到该窗口的方式显示,而无需更改聚焦窗口.效果一直持续到用户将焦点移到窗口上为止.如果窗口已经具有焦点,则此选项无效.设置为false可取消先前的抽奖注意请求.

If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request.

// You can pass -2 as windowId for the current window,
//  or query tabs/windows to get the one you want
chrome.windows.update(windowId, {drawAttention: true});

这篇关于如何使Chrome扩展程序的窗口在任务栏中闪烁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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