views:

243

answers:

2

Hi

I have two instances of Firefox running simultaneously next to each other. One window is in the front and the other one in the background. Both instances use the same target URL. Whenever I do a page reload in one of my instance the other instance loses the focus and gets minimized to the Windows taskbar.

Has anyone ever experienced this effect?

A: 

Could be a buggy 'onunload' handler. If both windows are open to the same page, then doing a reload in one will trigger onunload, which eventually calls window.blur(). If both windows are child windows of the same parent page (ie: created via window.open(), or regular link with target="somename"), they could be assigned the same name.

I don't know what FF"s priorities are on conflicting window names in JavaScript, but you could try opening the two windows in various orders, and reloading one or the other and see which one minimizes (if at all).

Marc B
+2  A: 

Thx for your answers. I ve found the problem. Some buggy jquery code returned a window reference rather than a DOM Element. The call to $(element).blur() ( element is a window reference ) now explains the strange behaviour.

Jay
+1 'cause I had no idea you could `.blur()` the `window` object.
Aistina