Omit the optional application argument to open (corrected.)
text/plain
462
Comments
Comment #0 by bugs-d — 2009-03-29T21:55:12Z
For categorization purposes, users on Macs may rename or move Safari.app from /Applications - it can even be uninstalled, if the user prefers another browser.
For example, I have multiple versions of Safari (and other browsers) on my test Mac, in /Applications/Browsers.
The open command doesn't require an application argument. Also, the argument need not be a full path, it can be just a name (such as "Safari", rather than "/path/to/Bundle.app".)
My suggestion would be to simply pass the path to open directly, and let it use the user's prefered browser. This seems to be the behavior on Windows and Linux.
-[Unknown]
Comment #1 by bugs-d — 2009-03-29T21:57:17Z
Created attachment 302
Omit the optional application argument to open.
This patch does what I suggest. An alternative would be to use "Safari", which would work even if they moved the app somewhere else, but not if they renamed it (OS X keeps a cached lookup of bundle ids and names.)
-[Unknown]
Comment #2 by bugs-d — 2009-03-29T23:21:26Z
Created attachment 303
Omit the optional application argument to open (corrected.)
Arg, sorry, I need to set this up properly to make patches everywhere.
-[Unknown]
Comment #3 by andrej.mitrovich — 2012-12-23T10:49:25Z
It now uses either "BROWSER" environment variable or "x-www-browser". I think this is fixed now (I can't test though).