1

I would like to open a URL in an already-running Firefox browser on my Mac (OSX 10.8.5).

Normally I would use: open -a firefox "$URL"

However, the /usr/bin/open command doesn't recognize the URL I am opening as a valid URL, and prepends file://... to it.

The command-line help for /Applications/Firefox.app/Contents/MacOS/firefox says it will accept a URL, and various online sources suggest that -new-tab or -remote options should work, but lots of people apparently are finding that these things do not work under OSX. I am one of those people.

So, any idea how to get this to work?

  • What's the URL? – slhck Oct 31 '13 at 7:06
  • The url is a proxy: URL that is used to set configurations within FoxyProxy. It works fine from the URL bar, and links inside web pages. – ZILjr Oct 31 '13 at 9:15
  • Well, I'm asking what, literally, the URL is? If your question is how to configure FoxyProxy for Firefox via the command line in OS X, then please ask that question instead of asking for your attempted solution. See also: What is the XY problem? Chances are you'll get a better answer. – slhck Oct 31 '13 at 9:24
  • I apologize if I somehow offended you by not being clear that the url will vary. It will always start with "proxy:" I'm afraid and deeply sorry that I cannot tell you the exact URL I will always be using since it will vary on each use. In my defense, you didn't say why you needed to know--why do you need to know? If you need an explicit example, you could use this (without the quotes): "proxy:foo.com&port=1234" See getfoxyproxy.org/developers/proxyprotocol.html for more detail if you also need it. How else can I help? – ZILjr Nov 2 '13 at 1:11
  • Not offended at all! I'm just suggesting that you rewrite your question to ask for what you really need to do, e.g. "How do I configure FoxyProxy via command line?" – that way you don't run the risk of getting answers like the one below which are technically right, but don't help you solve your problem (but how else could the answered know?) … in the end. – slhck Nov 2 '13 at 7:53
1

If the URL you are specifying does not begin with http://, it will be interpreted as a local file.

|improve this answer|||||
  • You're correct. The URL I am trying to open does not begin with http:// which is why /usr/bin/open prepends file://... My question is how to get firefox to open it from the command line on osx. Firefox is documented to support opening URLs from the command line, but that doesn't seem to work. – ZILjr Oct 31 '13 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.