Open new window of Tor Browser in Windows by command

I’m using tor.exe of TOR Browser as a proxy server for another program and also using it as a browser. The main empty window (without tabs) is moved to a secondary monitor to avoid closing it mechanically. But it is very uncomfortable to go to it and click File > New Window every time I want to browse.

How do I open a new window of the same TOR Browser instance? I’d create a link and click on it.


When reporting a bug, please include as many of these as possible:

  • Operating System you are using: Win11
  • Tor Browser version: Latest 15.0.7

You capitalized the word Windows so I assume the Windows OS. If not ignore this post.

I don’t want to steer you in the wrong direction so you may need to experiment.
The command line to open a new window in normal is firefox -new-window except it does not work for Tor Firefox.

I assume you use tor.exe from the Desktop folder in Windows. ....\Desktop\Tor Browser\Browser\TorBrowser\Tor

There is also a tor expert bundle which can be downloaded and it also has a tor.exe and I seem to remember it uses different ports than 9150 and 9151. Most probably 9050 and 9051.

Will this work? The expert bundle for your proxy and Tor Firefox browser for your use. Never tried it so I don’t know. That will be the experiment part.

Yes, it doesn’t work. Tor Browser seems to ignore the argument.

The point of my post was that you use the tor expert bundle and the tor.exe in it as the proxy for the other program. This tor.exe for the proxy remains open in a command line box. You can then put it on the secondary monitor or minimise it. Did you download the tor expert bundle?

Then you use the Tor browser when you need it by clicking the icon you normally use and no need for -new-window.

The fact that each tor.exe uses different ports suggests that it should work.

Edited later:
OK. This works. Never realized that I had tested this before and all the scripts were there.

With both the Tor browser started and tor.exe started in a terminal session this works through the Tor browser as a proxy
curl --proxy socks5h://127.0.0.1:9150 http://ip-api.com/json/

AND this works through tor.exe as a proxy
curl --proxy socks5h://127.0.0.1:9050 http://ip-api.com/json/

Notice the port difference 9150 and 9050. The tor.exe took a bit to completely start and be ready. There are probably some parameters to give.

Is there any place on the Internet, that is still not spoiled by LLMs?

As a human being, I want to write the following for any other human beings.

  1. https://wiki.mozilla.org/Firefox/CommandLineOptions These arguments (including -new-window) are mostly ignored by Tor Browser firefox.exe (only profile-related arguments work). In fact, some of them (-devtools, for instance) don’t work in ordinary Firefox as well (the wiki page is slightly outdated).
  2. I had knew the answer is “It’s not possible” before posting the question. Why did I ask then? Because:
    1. If something is not possible, it doesn’t mean a clever engineer can’t workaround it.
    2. If Tor Browser developers read this, they would know at least one user badly needs a feature they turned off (for an unknown reason – some sort of safety, I presume).

And something I forgot to mention. Obviously, I could run a separate instance of tor.exe as a SOCKS5 proxy from command line (even as a service) and then run Tor Browser as usual. But I’d like to use Tor Browser as a front-end for tor.exe. For setting and changing bridges, for building a new circuit, for checking, is the current circuit available. This is why I want to have a never-closing window for the proxy management and another for browsing.

What, on Earth, curl…

1 Like

You never mentioned any of this before so I had to assume and guess.
I assumed and guessed that you wanted a proxy for the other program and a browser for surfing which is what the HI in me read into the post. (HI=human intelligence) :slightly_smiling_face:

Edited later:

about:config → newwindow has options. Maybe there is something to experiment with.
If you do find something, let the rest of us know.

It seems, that starting tor.exe is hardcoded in a way to opening a window from outside.

At least, when I changed middlemouse.openNewWindow false → true, clicking on the Tor Browser icon with the wheel started showing the “is-already-running” message.


Here’s my solution I’m currently fine with (kind of). Hope, it helps for others who need the same behavior (returning the New Window feature from Firefox to the taskbar).

  • Install AutoIt. It’s a pretty good scripting language/interpreter. Saves your time, though you can write the same in C/C++/C#.
  • Create start-tor.au3:
#include <WinAPI.au3>
#Include <WindowsConstants.au3>    ; Some of them are not needed
#include <GUIConstantsEx.au3>      ; I tried to disable Close (x)
#include <WinAPISysWin.au3>        ; with CS_NOCLOSE -- to no avail
#include <WindowsStylesConstants.au3>

Opt("WinTitleMatchMode", 2) ; Substring mode for finding windows

Run("C:\Bin\Tor\Browser\firefox.exe")

Sleep(1000) ; It will be "restored" (unminimized)

Local $hWnd = WinWait("Tor Browser")
If IsHWnd($hWnd) Then

	; Move to the secondary monitor
	WinMove($hWnd, "", -1050, -400, 1000, 1000)
	WinSetState($hWnd, "", @SW_MAXIMIZE)
	WinSetTitle($hWnd, "", "MainTor")
	WinSetState($hWnd, "", @SW_MINIMIZE)

EndIf

This will be the main window. We rename it from “Tor Browser” → “MainTor” for future using as an anchor. It sits minimized silently and provides access to the tor.exe settings. Create a shortcut to the file and place it to the Startup folder, so it starts on login.

  • Create tor-new-window.au3:
#include <WinAPI.au3>

$hWnd = WinActivate("MainTor")

If IsHWnd($hWnd) Then

	Send("^n")

	Local $hNewWnd = WinWait("[TITLE:Tor Browser; CLASS:MozillaWindowClass]")
	If IsHWnd($hNewWnd) Then

		WinMove($hNewWnd, "", 30, 50, 1800, 900)
		WinSetState($hNewWnd, "", @SW_MAXIMIZE)

	EndIf

	WinSetState($hWnd, "", @SW_MINIMIZE)

Else ; If not found the window, start new Tor Browser instance

	Run("D:\Bin\Scripts\AutoIt\start-tor.au3")

EndIf

It finds the anchor (main) window, activates it, sends Ctrl + N, finds a newly opened window, move it to the primary monitor. If the anchor window is not found (Tor Browser is not running), it starts it anew.

  • Create a shortcut to tor-new-window.au3. (It’s a .lnk file).
  • Change its icon to the New Window icon from firefox.exe.
  • Open its properties. Add explorer.exe (space-concluded) at the beginning of the target field. Now click the Right Mouse Button and Pin to taskbar (without changing the target you are not allowed to pin a shortcut to the taskbar).
  • Click it every time you need a new window.

Damn, a lot of time and engineering for what could be done, if Tor Browser developers didn’t turn off the already working feature.

UPD. The window class MUST be specified, otherwise another window (preview) is found sometimes.

1 Like

What you want is remoting, which is disabled by default on Tor Browser as a way to prevent linkability.
If you launch your first window with --allow-remote, you should be able to launch additional windows from the command line.

That said, I don’t really understand why you’d use the browser’s tor process rather than using a separate tor instance.

1 Like
  1. I want tor.exe to be a singleton, so I could replace the bridges at once and for all applications. (I have to do it frequently).
  2. I need a GUI tool for bridges management, which Tor Browser already implements.

Just tried bot --allow-remote and -allow-remote (just in case). Nothing changed:

  1. firefox.exe --new-window “``https://google.com``” is still asking to close tor.exe.
  2. No FF-like Open new window command in the taskbar RMB-menu.

You need to pass --allow-remote in all invocations of firefox.exe, including firefox.exe --allow-remote --new-window.

Also, I suppose it’s telling you that the profile is locked, not to close tor.exe.

1 Like

This way it works as described. Thank you.

The old Tor Browser process must be closed to open a new window.” Well, tor.exe is not mentioned directly, maybe, another process is meant. The last firefox.exe or something.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.