Bug 138789

Summary: [PATCH] URLs opened from outside Firefox open in new windows, regardless of UI setting
Product: [Fedora] Fedora Reporter: Craig Box <craig>
Component: firefoxAssignee: Christopher Aillon <caillon>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: cdavis, cefrodrigues, chaghi, chris.ricker, davidf, mattdm, mitr, notting, ondrej, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.0.2-2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-25 18:00:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 136450, 136452    
Attachments:
Description Flags
Patch to firefox.js to set default pref for opening windows
none
patch to firefox.sh.in to not pass "new-window" to firefox none

Description Craig Box 2004-11-11 06:07:00 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20041109 Firefox/1.0

Description of problem:
Firefox 1.0 has an option "Open links from other application in".  I
wish to have this set to "A tab in the most recently used window".

The /usr/bin/firefox script that ships with Firefox on Fedora calls
firefox with the new-window parameter, so that each time a new window
is created.

Removing the new-window parameter (on line 224) causes the correct
behaivour.

Version-Release number of selected component (if applicable):
firefox-1.0-0

How reproducible:
Always

Steps to Reproduce:
1. Set Firefox as your default browser in Preferred Applications
2. Set "Open linsk from other applications in a tab in the most
recently used window" in the Firefox prefs
3. Click a link (from gnome-terminal for example)
4. Click a second link
    

Actual Results:  Two Firefox windows are opened.

Expected Results:  One window is opened with two tabs.

Additional info:

Comment 1 Warren Togami 2004-11-11 06:38:31 UTC
This wont be easy due to the inflexibility of the gconf-based system
used to launch the preferred applications.

Comment 2 Carlos Rodrigues 2004-11-29 22:17:05 UTC
I noticed this too.

Why must it be "openurl($URL,new-window)" and not "openurl($URL)"? I'm
not seeing the problem with doing this...

Comment 3 Warren Togami 2004-11-30 00:45:39 UTC
That is unacceptable to me.  I happen to LIKE new windows opening on
links from other programs, because it is impossible to open multiple
links because it replaces the current content of your browser window.

The only way to fix this is to extend the reach of the preference.
Anything less is unacceptable.

Comment 4 Carlos Rodrigues 2004-11-30 01:03:41 UTC
Well, when Firefox has "open links in a new tab in the most recent
window", the contents aren't replaced, as the preference says.
Besides, "openurl($URL)" does not impose any particular setting, it
honors the preference defined in firefox (new window/new tab/most
recent window).
With "openurl($URL,new-window)", the preference is ignored, which _is_
a bug.

Comment 5 Warren Togami 2004-12-02 06:02:25 UTC
*** Bug 141564 has been marked as a duplicate of this bug. ***

Comment 6 Warren Togami 2004-12-02 06:04:24 UTC
Ok, I think it would be acceptable to make this change to /usr/bin/firefox ONLY
IF our package default preference be changed to "new window" rather than the
current window.  Then advanced users like yourself can change it to their
preferred behavior.

caillon, your thoughts?

Comment 7 Carlos Rodrigues 2004-12-02 11:06:25 UTC
That would be just fine.

Comment 8 Warren Togami 2004-12-14 02:43:10 UTC
*** Bug 142775 has been marked as a duplicate of this bug. ***

Comment 9 Mariano Draghi 2004-12-14 12:33:28 UTC
First, sorry for the duplicate 142775. As Firefox is new in FC3, I
didn't look for the bug in "Devel" version.

Having read all these comments, I don't understand why we have to wait
for a "fix" in the package default preference to fix this bug. Firefox
has a preference so the user can choose if he/she likes a new window,
a new tab or the same window/tab. With the current behaviour,
/usr/bin/firefox *overrides* the user preference, which is very
annoying and frustrating (nobody is going to look into
/usr/bin/firefox, specially a newbie).

With the proposed fix in /usr/bin/firefox, *all of us* (advanced users
or not) can have firefox do whatever they choose in the preferences.

Comment 10 Warren Togami 2004-12-20 09:10:12 UTC
We have to cater to both advanced and newbie users.  The default
behavior of "open in the same window" is absolutely terrible.  For
this reason I suggest to the package maintainer to change that default
option while also changing /usr/bin/firefox.

If somebody submits a simple patch to change that default behavior,
maybe this can happen sooner.

Comment 11 David Fraser 2004-12-20 10:38:15 UTC
For reference, the config option is "browser.link.open_external" and
the options are accessible under Edit->Preferences->Advanced->Tabbed
Browsing: "Open links from other applications in:"
  (2) a new window
  (3) a new tab
  (1) the most recent tab/window (default)
The number given is the value of the preference for that option.


Comment 12 David Fraser 2004-12-20 10:55:25 UTC
Created attachment 108881 [details]
Patch to firefox.js to set default pref for opening windows

Added a patch to mozilla/browser/app/profile/firefox.js to set the default
preference to open links from external applications in a new window

Comment 13 David Fraser 2004-12-20 10:57:15 UTC
Created attachment 108882 [details]
patch to firefox.sh.in to not pass "new-window" to firefox

this just removes the ",new-window" parameter that is passed to firefox when
opening a new URL

Comment 14 David Fraser 2004-12-20 10:59:13 UTC
Attached the neccessary patches.

The prefs patch needs to be applied to
mozilla/browser/app/profile/firefox.js inside the tarball so it would
need a change to the spec file, or it could be added to another patch.

The other patch is to firefox.sh.in which is included as a source file
in the RPM.

These are untested but should work by principle, hopefully someone can
check them out and apply them.

Comment 15 Warren Togami 2005-02-25 03:41:25 UTC
caillon: his patches should work, but we are forbidden from patching firefox.js
caillon: use firefox-redhat-default-preferences.js
caillon: firefox.js is reserved for upstream

Chris said he'll fold this into FC4 soon along with many other patches.  It will
be tested there for a short while, then backported into a FC3 firefox update.


Comment 16 Matthew Miller 2005-02-28 15:38:09 UTC
*** Bug 144981 has been marked as a duplicate of this bug. ***

Comment 17 Warren Togami 2005-03-18 21:54:00 UTC
caillon said this is going in before FC4test2.

Comment 18 Christopher Aillon 2005-03-25 18:00:52 UTC
In tomorrow's rawhide.  Thanks for the patch, David, and sorry for the delay here.

Comment 19 Jens Petersen 2005-04-07 03:24:56 UTC
This patch just saved my sanity. :)

Comment 20 David Fraser 2005-04-07 07:36:09 UTC
Glad this has gone in, and to be saving people's sanity ...
Could someone report here if/when this goes into a FC3 update?

Comment 21 Carl Davis 2005-04-18 12:54:03 UTC
Could someone please report if there are plans on an update to FC3 or if we will
have to go to FC4 to get this fixed?