20-Jan-11 (Created: 20-Jan-11) | More in 'CS-JavaScript'

How to target an ie tab from javascript

We ran into a usecase where a user has to explicitly target a tab in ie. For example users have logged into salesforce.com cloud in one window. These users are then taking calls in that window. However same users are using another internet application to complete their work. It would be messy to open up these multiple windows every time work needs to be done.

It is probably better to target just one window and the user transferred to one window. Better yet to target a specific tab.

So started my search. I thought it ought to be simple. As it turned out there doesnt seem to be a good way to do this through regular unsigned javascript in ie7. I did find a way to do this in firefox.

ie seem to control tab vs new window purely through user configuration. Users can choose to set a global ie option to open new windows targeted by "_blank" to either an actual new window or a tab. Once they set this option as tab then the simple window.open(url) will open that url in a new tab.

I still want to force to open in a new tab. Perhas I will find a way through signed javascript. that is for another day or week.

If you are further curious what follows is my research and notes on how I came to this conclusion.