Bug 463949 - [Browsers] org.eclipse.ui.internal.browser.ExternalBrowserInstance.openUrl() should use open(1) --args on OS X
Summary: [Browsers] org.eclipse.ui.internal.browser.ExternalBrowserInstance.openUrl() ...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3.2   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: 4.5 M7   Edit
Assignee: Brian de Alwis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 405942 429546
Blocks:
  Show dependency tree
 
Reported: 2015-04-05 20:17 EDT by Brian de Alwis CLA
Modified: 2016-01-21 16:06 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian de Alwis CLA 2015-04-05 20:17:46 EDT
+++ This bug was initially created as a clone of Bug #429546 +++

Alex Blewitt notes:

> FWIW the Mac version of this uses 'open' with -a as the application id. Any arguments are currently dropped, but adding —args to the end of the open command will pass arguments through, e.g.
> 
> open -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --kiosk
Comment 1 Brian de Alwis CLA 2015-04-05 20:33:29 EDT
"--args" was added in OS X 10.6 (Snow Leopard), so I think it's pretty safe to assume its presence.

http://superuser.com/questions/180995/passing-command-line-args-to-open-on-mac#comment182858_181060
Comment 2 Eclipse Genie CLA 2015-04-08 09:50:39 EDT
New Gerrit change created: https://git.eclipse.org/r/45461
Comment 4 Brian de Alwis CLA 2015-04-08 10:23:31 EDT
 * Fix NPE when using Open Browser command from Quick Access
   (org.eclipse.ui.browser.openBrowser)
 * Use open(1) only if an app bundle is specified, otherwise treat as
   command-line launch
 * Hook in StreamConsumer to report launch messages to browser.log
 * Fix WebBrowserUtil#reportError as it assumed it was running on
   the SWT thread, which is not true with external browsers
Comment 5 Brian de Alwis CLA 2015-04-28 12:31:24 EDT
Failing in I20150428-0800 when the app is specified as an app bundle (e.g., /Application/Google Chrome.app) rather than a full path to its binary (/Applications/Google Chrome.app/Contents/MacOS/Google Chrome) and there is a browser instance already running.  I must have somehow only tested with no browser instance running.  

The "--args" arguments seem to be ignored when there is an already running instance, which makes sense as open(1) expects the URL to be specified before the "--args".
Comment 6 Eclipse Genie CLA 2015-04-28 20:45:19 EDT
New Gerrit change created: https://git.eclipse.org/r/46723
Comment 7 Eclipse Genie CLA 2015-04-28 20:50:51 EDT
New Gerrit change created: https://git.eclipse.org/r/46724
Comment 8 Lars Vogel CLA 2015-04-30 08:24:52 EDT
Both linked Gerrit reviews are abandoned. Is there still something to do here?
Comment 9 Brian de Alwis CLA 2015-04-30 12:29:10 EDT
Sorry Lars, I committed it directly as commit 67d4a262.  I forgot to put the change-id on it, so another change-set wasn't committed.
Comment 10 Brian de Alwis CLA 2015-05-05 20:35:37 EDT
Verified in I20150504-2000