How to automatically open .torrent and other files in Safari.
Posted on March 14, 2008
Filed Under Links, Mac
This an upgrade of the previous post, now much simpler and works with Snow Leopard too.
- First, you have to modify what Safari considers as a “safe” file. Check the option Open “safe” files after downloading in Safari’s Preferences panel.
- Download this plist and put it in the folder <your-username>/Library/Preferences.
- Finally restart Safari, that’s it!
If you want to digg deeper down: follow this guide.
- Create the file com.apple.DownloadAssessment.plist (if it doesn’t already exist) in the folder <your-username>/Library/Preferences.
- Then copy & paste the xml code stated below in the file. In this example for a .torrent file.
- Save it, restart Safari … and voilà!
<!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com-PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
<key>LSRiskCategorySafe</key>
<dict>
<key>LSRiskCategoryExtensions</key>
<array>
<string>torrent</string>
</array>
</dict>
</dict>
</plist>
Added on december 26th 2009. Thanks to Pan Maselko for this notice.
The most important part of the XML above is the <string>torrent</string> part. This describes the extension (.torrent) which is considered as safe for safari. So that, you can do this for almost any type of file, for example for .psd files. And of course you can have more than one extension to be safe at the same time. This can be done like this:
<!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com-PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
<key>LSRiskCategorySafe</key>
<dict>
<key>LSRiskCategoryExtensions</key>
<array>
<string>torrent</string>
<string>psd</string>
<string>xyz</string>
</array>
</dict>
</dict>
</plist>
Update:
For .rar files, thanks to dsuddya
<!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com-PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
<key>LSRiskCategorySafe</key>
<dict>
<key>LSRiskCategoryContentTypes</key>
<array>
<string>public.archive</string>
</array>
<key>LSRiskCategoryExtensions</key>
<array>
<string>rar</string>
</array>
</dict>
</dict>
</plist>
Comments
22 Responses to “How to automatically open .torrent and other files in Safari.”
Leave a Reply


thanks for this… works a treat!
Outstanding source! Worked flawlessly… had to restart safari 4 beta for it to take affect.
[...] Thanks to Manuel Studer for this [...]
I’ve always been annoyed that Safari wouldn’t open Quicken (.qdfm) files. This worked. Thanks!
Tks!, it works great as in Firefox but Safari 4 is so…cool!
… and so fast too.
thanks alot man, this worked great
I can’t get this to work in Snow Leopard. Any ideas?
@Chris
I’m going to install Snow Leopard next week, so maybe there is another solution.
WHY do they make it so damn hard? Morons.
This works for me in Snow Leopard no problem.
Excellent… saved me loads of time getting Citrix to run properly for work. THANK YOU!
thank you, but the plist link is a 404
Thanks for the help. Works beautifully!
Thank you
That works on Snow Leopard, but I have a problem: it works with .doc / .ppt / .xls, but not with .docx / .pptx / .xlsx, etc.
Do you have an idea how to fix this????
Many thanks by advance!
Francois
FWIW As a both a happy Safari and a happy Transmission user I’ve created an extension to directly send a torrent link from within Safari via right-click to the latter. Of course, this only makes sense, if your Transmission instance is running on another machine (i.e. your router etc., otherwise you should just download the torrent and double-click it). If you want to check it out: http://tomster.github.com/SendToTransmission.safariextension/
.rar is opened
LSRiskCategorySafe
LSRiskCategoryContentTypes
public.archive
LSRiskCategoryExtensions
rar
Works for Safari 5.1 on Mac OS X 10.6.8. Thanks.
dowload safari
download
Agreed, does NOT work with docx or xlsx. Any thoughts?
I can’t seem to get this solution to work with csv, xls or xlsx files. Am I doing something wrong in how I enter the file types in the plist file? This is what I’ve done:
csv
.csv
xls
.xls
xlsx
.xlsx
Any ideas?
Thanks!