Search code examples
javascriptgoogle-chromegoogle-chrome-extensionwindow

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


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?


Solution

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