14

Firefox 5.0 has the option to "switch to tab" if the requested URL or search terms point to an already open URL (great thing by the way).

Now, to open a URL from command line to Firefox a mere firefox http://myurl.com would do, but even if that URL already is open, Firefox will open it once more in another tab.

How can I---from command line---tell Firefox to open the desired URL in an already existing tab if possible?

4 Answers 4

14

You can do it like:

firefox -new-tab "https://www.useotools.com"

OR with full path

"C:\Program Files\Mozilla Firefox\firefox.exe" -new-tab "https://www.useotools.com"

2
  • 1
    Awesome! Thank you...
    – Atul
    Feb 3, 2020 at 8:34
  • 1
    Not sure why this got so many upvotes, but this command does not switch to an open tab. It just opens the URL in a new tab.
    – Dan
    Jul 18 at 14:12
2

Well at least one possible method is to modify your about:config files. See http://www.ghacks.net/2009/07/03/force-firefox-to-open-links-in-same-tab/ for details as to how to do this.

1
  • 1
    Well that's a cool thing, but it's indiscriminate. What I want is to be able to do that for particular URLs only and at particular times. Aug 16, 2011 at 8:41
1

It is not possible at the moment.

1
  • its possible ...
    – user889030
    May 1, 2019 at 19:00
0

firefox will work fine; if DISPLAY variable has a valid value; if not you need to set it manually

DISPLAY=:0.0; firefox "imgress.com"

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.