javascript open popups and firefox

In my Rails application, at a certain stage, it was necessary that my user performs an operation in another web-application (a GIS application) on the same database. I am using the following piece of code to make sure that i open a url in a new window, and that it should get the focus (jump to the front). [javascript] <% javascript_tag do -%> function newWindow(newContent, windowName) { var new_window; var new_window =, windowName); if (window.focus) new_window.focus(); } window.onload=function() { newWindow('<%= link_to_location @mention, true %>', '<%= @gisapp_window_name %>'); setTimeout(jump_to_select_tab_url, 2000); } <% end -%> [/javascript] All is well when the window is first opened, but if the window was already opened, still it fails. And of course i do all testing against firefox 3.5, although my user wants to use IE instead. So i try in IE and it works. Huh? So it has something to do with Firefox 3.5. And behold, as explained here, firefox is so smart it will block all javascript manipulation of windows, which is of course just what we need in this case. So inside firefox, i need to go to Options->Content->Javascript and make sure that i can run javascript that will manipulate opening and closing of windows. Done!

Add comment

Recent comments