Alex Rivera | Logout

Changing the window title when focussing the window doesn't work in Chrome

Asked 2010-06-01T18:47:44.950
12

I'm (ab)using the document title as some kind of a notification area. If the tab/window in question doesn't have focus at the time I want to notify the user of something, I change the window title to include some notification.

When the window/tab comes back into focus, I want to remove the notification, i.e. reset the title to standard. This resetting, however, sometimes doesn't work in Chrome.

When I come from a different window, the title gets updated correctly, but when I come from a different tab within the same window, it doesn't.

I have found a workaround for this (I'll post it as an answer), but please share any other ideas you might have to fix this.

Edit
Report

1 Answer

1

although tiftik said this bug is fixed, it still happend at my Chrome (Version 21).

The solution balpha offered works for me too - but be aware not to set the document title to the new title on Focus and than wait 200ms to set it again - This won't work! (probably because Chrome thinks it is the same title, so it won't update)

Just wait 200ms and set it - works fine!

answered 2012-09-20T09:41:38.423

Your Answer