Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Browser(tab) Events

    It baffles me, that I haven't found a solution to my problem, as it seems such a simple thing to implement. I just need to have an event fired, when the application browser window/tab loses/gains Focus (Browser Tab is switched, Browser is minimized/maximized) .
    What I've already tried:
    Attaching a focusChangedEvent to the main canvas (does nothing).
    Attaching specific Blur / FocusHandlers to the main canvas (does nothing).
    Attaching Blur / FocusHandlers to various elements inside the main canvas (does nothing).

    I've probably googled myself into a corner, where I am not able to see the obvious solution. Any help would be appreciated.

    #2
    To do this, you can make use of the (relatively recent) standard Page Visibility API:

    https://stackoverflow.com/questions/...rrently-active

    So far as we know, GWT has not added Java APIs for this, but here is a discussion where people have posted JSNI to use this API:

    https://groups.google.com/g/google-w...7Bf3A_nE?pli=1

    Comment

    Working...
    X