Window.getAttention()

Summary

Attempts to get the user's attention. How this happens varies based on OS and window manager.

Syntax

JavaScript
window.getAttention();

Notes

On Windows, the taskbar button for the window flashes, if this hasn't been disabled by the user.

On Linux, the behaviour varies from window manager to window manager - some flash the taskbar button, others focus the window immediately. This may be configurable as well.

On Macintosh, the icon in the upper right corner of the desktop flashes.

The function is disabled for web content. Neither Gecko nor Internet Explorer supports this feature now for web content. getAttention will still work when used from chrome in a Gecko application.

Specification

DOM Level 0. Not part of specification.

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/window/getattention

API DOM DOM Reference Gecko Method Reference Référence