Marketplace for Content, Tests and Assessment
 
 
Home > Programming / tutorials > Open new tab instead of new window in Firefox

Open new tab instead of new window in Firefox

We had a requirement in which we wanted to open an applet in a new tab instaed of new window.

Here is how to do it

window.open(”, server[0], ‘height=1,width=1,left=1,top=1,status=yes,scrollbars=yes,resizable=yes’);

change this to

window.open(”, server[0]);

This will open the applet in new tab. As soon as you remove sizing parameters, it will open as a new tab.

But there is one issues here. The focus is on the applet tab instead on main screen.
To resolve this , change default settings in firefox config.

browser.tabs.loadDivertedInBackground=true

How to do this ?

Changing default settings in Firefox

Type about:config in firefox address bar . It will show the following screen with warning

firefxo config settings

Click on “I will be careful I promise”. Then you will see the list of properties. Look for browser.tabs.loadDivertedInBackground which is by default false.  Double click on it and the value changes.

browser.tabs.loadDivertedInBackground=true.

Also check for this property browser.link.open_newwindow.

browser.link.open_newwindow = 3

Its value should be 3.

After these changes once you run your application,  the focus comes back on main window.

Since IE 7  supports tab , this should work on IE7. In IE6 it opens in a new window (there is no tab support in IE 6)

  1. No comments yet.
  1. No trackbacks yet.
Get Adobe Flash playerPlugin by wpburn.com wordpress themes