Open Bug 856092 Opened 8 years ago Updated 5 years ago

Open all links in the current tab, except the pages opened from external apps — open these ones in new windows

Categories

(Firefox :: Tabbed Browser, defect)

defect
Not set
normal

Tracking

()

UNCONFIRMED

People

(Reporter: nicolas.barbulesco, Unassigned)

Details

Hello, brave people of Firefox !

Here is my request :

I want Firefox to open the links in the current tab, except the pages opened from external apps — I want these ones to open in new windows.

First choice : make this the default behaviour. I think this behaviour should be the default behaviour of Firefox. Alas, I do not expect to see this anytime soon. I don't see why, by the way.

So, if I don't have the first choice, then as second choice I want to be able to set this behaviour using the prefs user-friendly UI.

If I don't have the second choice, then as a third choice I want to set this behaviour using the "about:config" secret prefs. According to the — obsolete — page-acting-as-documentation http://kb.mozillazine.org/About:config_entries , this is not possible — except if I missed something.

Thank you for making Firefox more user-friendly. In the meantime, if you can give me a workaround or a "secret pref" hint, this would been appreciated.

Cheers,

Nicolas Barbulesco
Blocks: useragent
> I want Firefox to open the links in the current tab, except the pages opened from external apps
> — I want these ones to open in new windows.

Please give exact steps of reproduction.
From how I understand your request, this is already the case, at least on my system.
No longer blocks: useragent
Here's what I understand:

Reproduction:
1. Open any webpage with a normal link <a href="...">
2. Click on the link
3. Go to Thunderbird
4. Click on any link in an email

Expected Result:
Step 2: linked page opens in the same tab as the previous page in step 1.
Step 4: linked page opens in a new tab, in the last-used Firefox window

Actual result:
As expected result
Environment: Linux, Ubuntu, Firefox
Ben,

First of all, I don't want the Thunderbird link to alter my existing Firefox window. I want it to create a new window. This is cleaner. Especially because Firefox, after I close such a new tab, does not always bring me back to the tab I had before — unlike Internet Explorer for instance.

Secondly, your step 1 is too easy. I not only want the normal behaviour with normal links. I want it with “jumping” links too. You know, the target="_blank" links. This attribute is a totally non-standard bad habit of some Web authors, and Firefox should ignore it. Hence the dependency I had put with the request bug 86194.
Summary: Open the links in the current tab, except the pages opened from external apps — open these ones in new windows → Open all links in the current tab, except the pages opened from external apps — open these ones in new windows
When I say “open the links in the current tab”, I mean all links. Of course this is in absence of specific user decision, like middle-click or Apple-click or link drag-and-drop…
> target="_blank" links

That's bug 565621, bug 64560, and bug 142712

> I want it to create a new window.

See
http://kb.mozillazine.org/Browser.link.open_external
http://kb.mozillazine.org/Browser.link.open_newwindow
http://kb.mozillazine.org/Browser.link.open_newwindow.restriction
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 565621
(In reply to Ben Bucksch (:BenB) from comment #5)

> > I want it to create a new window.
> 
> See
> http://kb.mozillazine.org/Browser.link.open_external
> http://kb.mozillazine.org/Browser.link.open_newwindow
> http://kb.mozillazine.org/Browser.link.open_newwindow.restriction

Among these secret prefs, the only one dealing with pages opened from external apps is "open_external". The page you gave says this was removed in Firefox 3.5.

> *** This bug has been marked as a duplicate of bug 565621 ***

This is not entirely a duplicate.
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---
Component: General → Tabbed Browser
1. Type about:config into the address bar and press Enter.
2. To bypass the warning, press the big button labeled “I'll be careful, I promise!”.
3. In the search box, paste browser.link.open_newwindow
4. In the search results, double-click browser.link.open_newwindow and set its value to 1
5. In the search results, double-click browser.link.open_newwindow.restriction and set its value to 0
6. In the search results, double-click browser.link.open_newwindow.override.external and set its value to 2

Reference:
https://hg.mozilla.org/releases/mozilla-release/annotate/784a4c059370/browser/app/profile/firefox.js#l431
https://hg.mozilla.org/releases/mozilla-release/annotate/784a4c059370/browser/app/profile/firefox.js#l440
https://hg.mozilla.org/releases/mozilla-release/annotate/784a4c059370/browser/app/profile/firefox.js#l435
(In reply to Gingerbread Man from comment #7)

> In the search results, double-click
> browser.link.open_newwindow.override.external and set its value to 2

Thank you. This is interesting. Is this hidden pref browser.link.open_newwindow.override.external documented somewhere? I don't find.
Flags: needinfo?(gingerbread_man)
(In reply to Nicolas Barbulesco from comment #8)
> Thank you. This is interesting. Is this hidden pref
> browser.link.open_newwindow.override.external documented somewhere? I don't
> find.

You're welcome. There's no official documentation for about:config preferences [1]. You can either look at the comments in the source code [2], or the MozillaZine knowledge base [3].

// handle links targeting new windows
// 1=current window/tab, 2=new window, 3=new tab in most recent window
pref("browser.link.open_newwindow", 3);

// handle external links (i.e. links opened from a different application)
// default: use browser.link.open_newwindow
// 1-3: see browser.link.open_newwindow for interpretation
pref("browser.link.open_newwindow.override.external", -1);

―――――――
[1] Bug 697655
[2] http://mxr.mozilla.org/mozilla-release/source/browser/app/profile/firefox.js#417
[3] http://kb.mozillazine.org/Browser.link.open_external
Flags: needinfo?(gingerbread_man)
(In reply to Gingerbread Man from comment #9)

> There's no official documentation for about:config
> preferences [1]. You can either look at the comments in the source code [2],
> or the MozillaZine knowledge base [3].
> 
> // handle links targeting new windows
> // 1=current window/tab, 2=new window, 3=new tab in most recent window
> pref("browser.link.open_newwindow", 3);
> 
> // handle external links (i.e. links opened from a different application)
> // default: use browser.link.open_newwindow
> // 1-3: see browser.link.open_newwindow for interpretation
> pref("browser.link.open_newwindow.override.external", -1);
> 
> ―――――――
> [1] Bug 697655
> [2]
> http://mxr.mozilla.org/mozilla-release/source/browser/app/profile/firefox.
> js#417
> [3] http://kb.mozillazine.org/Browser.link.open_external

Thank you Ginger Man for this info. 

Alas, the knowledge base [3] is for a different hidden pref, "removed in Firefox 3.5". The new hidden pref browser.link.open_newwindow.override.external is a good news. It would be fully usable if documented. At worst, I will look in the source code with the links you gave.
(In reply to Nicolas Barbulesco from comment #10)
> Alas, the knowledge base [3] is for a different hidden pref, "removed in
> Firefox 3.5". The new hidden pref
> browser.link.open_newwindow.override.external is a good news. It would be
> fully usable if documented.

The preference name has changed, but the possible values and their effects are the same.

> At worst, I will look in the source code with the links you gave.

At comment 7, I posted step-by-step directions.
At comment 9, I posted the source code comments that explain how the preference works. Links [2] and [3] just repeat the same information.
You need to log in before you can comment on or make changes to this bug.