How do I make a Chrome extension's window blink in the taskbar?

倖福魔咒の 提交于 2019-12-30 10:12:31

问题


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?


回答1:


Yes, it's possible with the windows API:

drawAttention

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});


来源:https://stackoverflow.com/questions/27520255/how-do-i-make-a-chrome-extensions-window-blink-in-the-taskbar

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