Firefox with "Open in new Tab" as preferred application does not show

Bug #41849 reported by René Brandenburger
26
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Fix Released
Medium
gnome-utils
Fix Released
Undecided
Unassigned
gnome-utils (Ubuntu)
Fix Released
Medium
Ubuntu Desktop Bugs

Bug Description

Setting firefox as preferred application with the setting "open link in new tab" only works if firefox already running. If firefox is not yet running, nothing happens.
the command shown in the Preferred application Choser is

firefox -remote "openurl(%s,new-tab)"

Using Dapper beta updates applied till 27.4.2006

description: updated
Revision history for this message
Andy Price (andy-price) wrote :

Thanks for your bug report. I'm confirming this as when firefox is not running,

firefox -remote "openurl(%s,new-tab)"

doesn't do anything.

Revision history for this message
Andy Price (andy-price) wrote :

I meant to replace the %s with a url in the previous comment, but you get the picture.

Revision history for this message
Andy Price (andy-price) wrote :

A possible fix:

firefox -new-tab %s

Might need testing though as i've tweaked my firefox settings a bit in how it opens new links.

Revision history for this message
René Brandenburger (rene-brandenburger) wrote :

using "firefox -new-tab %s" actually starts firefox as expected, but does not load the desired page, the default home page is shown instead.
If firefox is running everything is fine ...

tested with fixes till may 4rth applied

Revision history for this message
In , Fusi (fusi) wrote :

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1) Gecko/20061010 Firefox/2.0

when passing the commandline argument "-new-tab <url>" to firefox, the <url> will not be loaded if there is no existing browser window (browser window being the main window (tabs, webpages etc)).

the same thing happens if the download/addon/etc window(s) are open, but there is no existing browser window.

the result of passing the "-new-tabs <url>" commandline argument to firefox in these cases results in a browser window being opened to the default home page; the <url> is not loaded.

Reproducible: Always

Steps to Reproduce:
1. close all firefox main browser windows (you can leave the download/addon/etc windows open if you like)
2. run firefox with the "-new-tabs <url>" commandline (replace <url> with your favourite url ;)
3. watch your home page appear :(

Actual Results:
new browser window is created containing the users home page

Expected Results:
a new browser window should appear that contains the <url> specified on the command line

Revision history for this message
In , Bugzilla-olliholliday (bugzilla-olliholliday) wrote :

i get this too!

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

Created attachment 243392
patch

handURIToExistingBrowser() tries to use cmdLine (if getMostRecentBrowserWindow() returns null), but it isn't defined.

Revision history for this message
In , Fusi (fusi) wrote :

patch works here

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

Checked in on the trunk.

mozilla/browser/components/nsBrowserContentHandler.js 1.29

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

Comment on attachment 243392
patch

This fix only affects -openURL(<url>,new-tab) and -new-tab command line parameters. The risk of regression is nearly 0 (passing an extra argument to a function that already uses it to avoid throwing an exception).

Revision history for this message
In , Dveditz (dveditz) wrote :

Comment on attachment 243392
patch

approved for 1.8 branch, a=dveditz for drivers

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

mozilla/browser/components/nsBrowserContentHandler.js 1.12.2.14

Revision history for this message
In , Jbecerra-mozilla (jbecerra-mozilla) wrote :

Verified using steps in bug description with: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1pre) Gecko/20061130 BonEcho/2.0.0.1pre

Revision history for this message
Alex Latchford (alex.latchford) wrote :

Assigning this to myself while I try to figure out the correct method of opening remote tabs.

Changed in firefox:
assignee: nobody → admin-yawnster
Revision history for this message
Alex Latchford (alex.latchford) wrote :

Okay, the correct command(s) are..

firefox -new-tab <url>
firefox -new-window <url>

I will keep this assigned to me for now whilst I try to find who to assign this too.

Thanks again, Alex.

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

Comment on attachment 243392
patch

This should land on the 1.8.0 branch too, it's a simple fix that causes headaches for linux users.

Changed in firefox:
status: Unknown → Fix Released
Revision history for this message
In , Jay-mozilla (jay-mozilla) wrote :

Comment on attachment 243392
patch

Approved for 1.8.0 branch, a=jay for drivers.

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

mozilla/browser/components/nsBrowserContentHandler.js 1.12.2.5.2.3

Revision history for this message
Alex Latchford (alex.latchford) wrote :

Assigning this to the Desktop Team, hopefully they know a little more about who can fix this properly than I do.

Thanks, Alex.

Changed in firefox:
assignee: admin-yawnster → desktop-bugs
Revision history for this message
In , Cbook (cbook) wrote :

Verified 1.8.0.10 using steps in this bug description with Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.0.10pre) Gecko/20070207 Firefox/1.5.0.10pre ID:2007020706

Revision history for this message
Henrik Nilsen Omma (henrik) wrote :

Still not working in Gutsy as Preferred Application still uses the wrong string. It works fine if you set a custom string and use -new-tab -new-window though. Installing Epiphany and setting this as default makes it work fine again. So this seems to be a Preferred Applications bug that hits those distros and users that do not choose epiphany as the default. Adding upstream task to Gnome.

Revision history for this message
gnudoc (gnudoc) wrote :

Fixed in current gutsy beta (1/10/07)
Steps to reproduce:
System -> Preferences -> Preferred Applications.
In the 'Internet' tab, under Web Browser, choose "Open link in new tab".This sets the command as `firefox -new-tab "%s"`.
Make sure all firefox windows are closed.
Find a local html file in nautilus.
Double-click the file -> firefox opens, with local file displayed.
:)

Changed in gnome-utils:
status: Confirmed → Fix Released
gnudoc (gnudoc)
Changed in gnome-utils:
status: New → Fix Released
Changed in firefox:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.