Last Comment Bug 380163 - Run commandline handlers on Mac when the app is already running
: Run commandline handlers on Mac when the app is already running
Product: Toolkit
Classification: Components
Component: Startup and Profile System (show other bugs)
: Trunk
: All Mac OS X
-- major with 1 vote (vote)
: mozilla1.9.2a1
Assigned To: David Humphrey (:humph)
: Benjamin Smedberg [:bsmedberg]
Depends on:
Blocks: 290057 303568 304704 309212 481728
  Show dependency treegraph
Reported: 2007-05-09 09:25 PDT by Phil Ringnalda (:philor)
Modified: 2009-03-05 13:37 PST (History)
12 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Remove OpenUrl, OpenWindow, use -url (3.54 KB, patch)
2009-02-02 16:36 PST, David Humphrey (:humph)
jaas: review+
benjamin: superreview+
Details | Diff | Splinter Review

Description User image Phil Ringnalda (:philor) 2007-05-09 09:25:28 PDT
On everything but Mac, whether or not the app is already running, "foo.exe" sends through everything registered in the "command-line-handler" category, while on OS X we send it down the normal route if the app isn't running, and send it as window.arguments to a new browser.chromeURL window if the app is already running.

That screws up sending external URLs to full windows instead of limited popups for Firefox (bug 303568), and screws up sending URLs of RSS feeds to Thunderbird, which uses a message compose window for browser.chromeURL since it mostly expected mailto: URLs (bug 304704) and apparently doesn't work out well for ActiveState (bug 309212), and is certain to cause unexpected trouble for any extension that tries to do commandline handling, particularly if the author doesn't own a Mac.
Comment 1 User image David :Bienvenu 2007-05-09 10:15:05 PDT
I did something like this on the 1.8 branch for Thunderbird so Spotlight could run a thunderbird command line with the name of the .mozeml file to load. I really need this to work on the trunk at some point as well.
Comment 2 User image David Humphrey (:humph) 2008-12-05 09:15:27 PST
I am updating attachment 246624 [details] [diff] [review] for bug 290057 on trunk, and I was trying to test this last night by clicking an RSS feed in Safari.  However, this never went through my code at all.  I eventually tracked it down to how we deal with a file vs. url arg:

My question is: what should we do with a url?  Is it always right to pass the url through vs. opening a window, or is it also sometimes right to open it in a window?
Comment 3 User image Benjamin Smedberg [:bsmedberg] 2008-12-05 09:17:53 PST
I think we should never open a window and get rid of the very strange browser.chromeURL code. Instead, always go through command-line handlers with the -url <URL> argument. I'm not sure what we should do with files: perhaps pass them as -file <file>
Comment 4 User image David Humphrey (:humph) 2009-02-02 16:36:03 PST
Created attachment 360194 [details] [diff] [review]
Remove OpenUrl, OpenWindow, use -url

Patch to follow-up work in  This might be too aggressive, but it works when tested in the ways described above.
Comment 5 User image David Humphrey (:humph) 2009-02-13 13:13:49 PST
thanks for the reviews, guys.
Comment 6 User image Phil Ringnalda (:philor) 2009-02-15 19:15:51 PST
Comment 7 User image Phil Ringnalda (:philor) 2009-02-24 20:43:38 PST
Comment on attachment 360194 [details] [diff] [review]
Remove OpenUrl, OpenWindow, use -url

Should be very minimal impact on Firefox (just making Mac act like every other platform when the app's running, the way it already does when the app isn't already running), and Tb3 really desperately needs it.
Comment 8 User image philippe (part-time) 2009-02-28 20:33:30 PST
Could this possibly have caused bug 480733 ?

Note You need to log in before you can comment on or make changes to this bug.