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?
Asked
Active
Viewed 2,759 times
1 Answers
2
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});
-
I got this to work for the background script, but is there any way to use it for the content script too? – Sean Dec 22 '14 at 09:23
-
No. Content scripts cannot access most of the Chrome APIs for security reasons. If you want to initiate it from a content script, [send a message](https://developer.chrome.com/extensions/messaging) to the background script to do it. – Xan Dec 22 '14 at 09:25