Skip to content
This repository has been archived by the owner on May 15, 2018. It is now read-only.

Add the ability to run firefox from .app on OSX #5

Open
BeyondEvil opened this issue Mar 16, 2017 · 9 comments
Open

Add the ability to run firefox from .app on OSX #5

BeyondEvil opened this issue Mar 16, 2017 · 9 comments

Comments

@BeyondEvil
Copy link

Instead of having to provide the full path, ie /Applications/Firefox.app/Contents/MacOS/firefox-bin, you should have the option to just do /Applications/Firefox.app/ (or any other path to a Firefox.app).

I have no exp. with rust and I have no idea how long it will take for me to provide a patch. But I guess... um... challenge accepted? heh

@BeyondEvil
Copy link
Author

@jgraham After talking to @davehunt, there's some confusion as to where this patch belongs and how to implement it. I was hoping you could weigh in. :)

Here's one suggestion:
https://github.com/mozilla/geckodriver/blob/master/src/marionette.rs#L325-L329

Another one is to extend the firefox_default_path() or create a similar, something like firefox_custom_path (which takes the aformentioned .app).

@whimboo
Copy link
Contributor

whimboo commented Mar 22, 2017

See https://github.com/mozilla/mozbase-deprecated/pull/9/files how we got this implemented for the Python implementation of mozrunner. But well, meanwhile it got removed again, because it added additional complexity.

@BeyondEvil
Copy link
Author

@whimboo Thanks for that. So... I shouldn't add it to the mozrunner then?

@jgraham
Copy link
Owner

jgraham commented Mar 22, 2017

I will happily review a patch; if it's too complex we can decide then. It should be added to firefox_default_path in mozrunner (note that this is not the same implementation as the python one mentioned above).

@BeyondEvil
Copy link
Author

BeyondEvil commented Mar 22, 2017

@jgraham Thanks, I'm happy to give it a shot. I still have some left of my sanity.

So that means I have to change firefox_default_path to take an optional argument/parameter (the path to the .app) which in turn means that marionette.rs needs to be patched to pass it to firefox_default_path.

Is that a correct assessment?

@whimboo
Copy link
Contributor

whimboo commented Mar 22, 2017

So if this gets added to the firefox_default_path which code actually determines the binary to be used? Or how do you want to start Firefox via the .app bundle?

@BeyondEvil
Copy link
Author

@whimboo Well, my approach would be to assume /Contents/MacOS/firefox-bin

So you send in for instance /path/to/Firefox52.app/ and the function does the rest.

@jgraham
Copy link
Owner

jgraham commented Mar 22, 2017

Sorry, I think firefox_default_path was a red herring; I was thinking of the case where we can locate the app bundle and need to find the binary inside it.

Otherwise, adding something to mozrunner to take a path and return a binary path (which on OSX might check if it's an app budle and locate the binary inside that, and on other platforms might be a noop) sounds reasonable.

@whimboo
Copy link
Contributor

whimboo commented Mar 23, 2017

Well, my approach would be to assume /Contents/MacOS/firefox-bin

Keep in mind that this will only work for Firefox but will file for other type of applications in the future. Using the plist might be ideal here to retrieve the real binary. As @jgraham pointed out to me via IRC there are two possible crates available: https://crates.io/search?q=plist

@BeyondEvil BeyondEvil changed the title Add the ability to run firefrox from .app on OSX Add the ability to run firefox from .app on OSX Mar 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants