How to set up firefox such that it will open a new window after I click a link?
Hi,
I want to open a new window after I click a link at current webpage. I have tried to set browser.link.open_newwindow = 2 and browser.link.open_newwindow.restriction = 0 . But still doesn't work. Please help. Thanks.
All Replies (9)
Can anyone please help?
Hi kinny, Firefox will normally open a link in the same tab unless it is specially coded by the site to open in a new window. To force a new window, you can hold down the Shift key when clicking, or right-click > Open Link in New Window.
Firefox's built-in settings can select between whether that specially coded link opens in a new tab instead of a new window, but I don't think there is a built-in setting to force regular links into a new window, if that's what you want to do. You would need an add-on for that, or some sites like search engine results pages have an option for that.
You can hold down the Shift key to force opening a link in a new window with browser.link.open_newwindow = 2 The browser.link.open_newwindow pref with a left-click only works for links that specify a target window. For links that would normally open in the current tab you cannot use this pref and need to hold Shift or use the context menu.
In fact, I have programmed the aspx webpage such that it will open in a new window when click and it works perfect with Internet Explorer but doesn't work in FireFox. Now I hold the left-shift key and click the link. A webpage open in a new tab (but not in a new window as antipicated) and an error displays "This program cannot display the webpage..." . I tried to left click the link and select "open in New Window" and still not working and get the same error. Please help. Thanks a lot.
I think the target="_blank" in the link (or window.open() in an onclick handler in the link) is working. As for the other two parts:
(1) tab vs. window
Your setting is correct. Possible reasons for Firefox to get it wrong would be:
- Firefox confused about your Ctrl key being up or down: if multiple keys are behaving as though Ctrl is held down, tap the key several times to try to clear the incorrect state
- An extension is overriding the built-in setting: you can review your extensions on the Add-ons page, either:
- Ctrl+Shift+a
- "3-bar" menu button (or Tools menu) > Add-ons
In the left column, click Extensions, then consider whether anything on the right side might be tab-related.
(2) page not loading
Can you see anything odd about the link in the address bar?
Bear in mind that unlike IE, you cannot use backslashes in a href or src path in Firefox, they get encoded as %5C and are not resolved as forward slashes.
Can you give more details of how you have coded it an possibly post a code example?
You can use the HTML entity code < for < and > for >
I will describe a bit more detail on my program. So I am running an aspx webpage and have a link generated by asp.net dynamically. And I have a link click event in javascript in aspx which use window_open(that link) function. Using Internet Explorer is perfectly fine. After I click on this link, a new window will popup containing the content. but using FireFox will only open in a separate new tab. Please help. Thanks.
Okay, yes, by default, Firefox will divert both target="_blank" and window.open() to a new tab, unless you have specified window features. By that I mean, for example, the width and height. You can use these links for demonstration purposes:
http://jeffersonscher.com/res/popit.html
But if you change the preference in Options (uncheck "Open new windows in a new tab instead") then you should get new windows in all 3 cases.
Hi Guys,
Thanks a lot for the advice. Appreciated.
But I already have the preference option unchecked. For some reasons, don't work. I think I can live with it. Thanks again for your helps. Cheers.