So what I'm trying to do is create a protocol called "opentor" and when used like "opentor://http://www.website.com/" it'll open that website in tor from another browser. I've gotten the URI scheme working, and it's opening tor when I use it, but it's not opening the link in it. What is the problem to this? Is it a bug in tor? Is there something I'm missing? Or is it just not possible at all?
Trac: Username: AlienDrew
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
This is also a ticket with helpful information on the URI scheme for macOS and Linux. #24052 (moved)
This bug report may explain why you can not use the URI scheme. #22419 (moved)
Actually, nah, it wasn't that. I actually figured it out, but I needed to use a .bat file to configure user input correctly. I have the protocol working just fine now
I created a this script that could be used as a browser protocol to say, like open a link from chrome, but in the TOR Browser. I decided to change the name of the protocol itself to "tor-browser" because it kinda makes sense.
Below is the code I had put together, and it receives the input like any other protocol through the %0.0.8 final param: ("opentor.bat")
@echo offREM Created by AlienDrew thealiendrew@gmail.comif [%1] == [] got :eofset "browser_dir=%windir:~0,2%\Program Files (x86)\Tor Browser\Browser\firefox.exe"set "url=%1":: for some reason, args passed by the system get screwyecho %1 | find "tor-[/"](/") > nulif errorlevel 0 set "url=%url:~15,-1%":: I do admit that this could cause problems in the futuretasklist /fi "imagename eq firefox.exe" | find ":" > nulif errorlevel 1 (start /b "" "%browser_dir%" --allow-remote --new-tab "%url%"endlocal && exit)start /b "" "%browser_dir"% --allow-remote "%url%"endlocal && exit
And this I had put in the "Tor Browser\Browser" directory. As for Tor, I decided to put it in the "Program Files (x86)" but the script could easily be changed to do more than that.
But what pieces this together is the registry keys needed to create to protocol. Listed below, some commands that you can use in a .bat to register the keys needed: (admin access required!)
@echo off & setlocalset "tor_dir=%windir:~0,2%\Program Files (x86)\Tor Browser"reg add HKCR\tor-browser /ve /d "URL:tor-browser Protocol" /freg add HKCR\tor-browser /v "URL Protocol" /t REG_SZ /freg add HKCR\tor-browser\shell\open\command /ve /d "\"%tor_dir%\Browser\opentor.bat\" \"%%1\"" /f:: same directory as when I first mentioned the "open to.bat" file
But these two things combined with the browser should work just fine. Not the best solution I'm sure but it works for me.
Trac: Username: AlienDrew Resolution: N/Ato fixed Status: new to closed
Oh and... Just typing something like "tor-/www.link-to-a-site.com/" in most browsers should work (some you have to press Ctrl-Enter to accept the protocol).