Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 463949

Summary: [Browsers] org.eclipse.ui.internal.browser.ExternalBrowserInstance.openUrl() should use open(1) --args on OS X
Product: [Eclipse Project] Platform Reporter: Brian de Alwis <bsd>
Component: UIAssignee: Brian de Alwis <bsd>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: alex.blewitt, Lars.Vogel, obuligan, psuzzi, tomasz.zarna
Version: 4.3.2   
Target Milestone: 4.5 M7   
Hardware: Macintosh   
OS: Mac OS X   
See Also: https://git.eclipse.org/r/45461
https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=78cb5dc8ea5ef47b5e38ae532f62bc0dafaeec5c
https://git.eclipse.org/r/46723
https://git.eclipse.org/r/46724
https://bugs.eclipse.org/bugs/show_bug.cgi?id=475775
Whiteboard:
Bug Depends on: 405942, 429546    
Bug Blocks:    

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