Closed Bug 357853 Opened 18 years ago Closed 18 years ago

if no browser window exists, "-new-tab <url>" commandline argument does not open <url>

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 3 alpha1

People

(Reporter: fusi, Assigned: Gavin)

References

Details

(Keywords: verified1.8.0.10, verified1.8.1.1)

Attachments

(1 file)

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
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: unspecified → Trunk
i get this too!
Attached patch patchSplinter Review
handURIToExistingBrowser() tries to use cmdLine (if getMostRecentBrowserWindow() returns null), but it isn't defined.
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Attachment #243392 - Flags: review?(benjamin)
Whiteboard: [patch-r?]
Target Milestone: --- → Firefox 3 alpha1
patch works here
Attachment #243392 - Flags: review?(benjamin) → review+
Checked in on the trunk.

mozilla/browser/components/nsBrowserContentHandler.js 	1.29
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
OS: Windows XP → All
Hardware: PC → All
Resolution: --- → FIXED
Whiteboard: [patch-r?]
Comment on attachment 243392 [details] [diff] [review]
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).
Attachment #243392 - Flags: approval1.8.1.1?
Comment on attachment 243392 [details] [diff] [review]
patch

approved for 1.8 branch, a=dveditz for drivers
Attachment #243392 - Flags: approval1.8.1.1? → approval1.8.1.1+
mozilla/browser/components/nsBrowserContentHandler.js 	1.12.2.14
Keywords: fixed1.8.1.1
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
Status: RESOLVED → VERIFIED
Comment on attachment 243392 [details] [diff] [review]
patch

This should land on the 1.8.0 branch too, it's a simple fix that causes headaches for linux users.
Attachment #243392 - Flags: approval1.8.0.10?
Comment on attachment 243392 [details] [diff] [review]
patch

Approved for 1.8.0 branch, a=jay for drivers.
Attachment #243392 - Flags: approval1.8.0.10? → approval1.8.0.10+
mozilla/browser/components/nsBrowserContentHandler.js 	1.12.2.5.2.3
Keywords: fixed1.8.0.10
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
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: