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.

  1. 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.
  2. Download this plist and put it in the folder <your-username>/Library/Preferences.
  3. Finally restart Safari, that’s it!

If you want to digg deeper down: follow this guide.

  1. Create the file com.apple.DownloadAssessment.plist (if it doesn’t already exist) in the folder <your-username>/Library/Preferences.
  2. Then copy & paste the xml code stated below in the file. In this example for a .torrent file.
  3. 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.”

  1. Casemon on December 12th, 2008 8:11

    thanks for this… works a treat!

  2. Brandon on April 4th, 2009 20:21

    Outstanding source! Worked flawlessly… had to restart safari 4 beta for it to take affect.

  3. corewerkz» Safari: Open .torrent Files Automatically After Downloading on April 12th, 2009 19:44

    [...] Thanks to Manuel Studer for this [...]

  4. Mike on May 7th, 2009 0:20

    I’ve always been annoyed that Safari wouldn’t open Quicken (.qdfm) files. This worked. Thanks!

  5. Lele on June 16th, 2009 16:23

    Tks!, it works great as in Firefox but Safari 4 is so…cool!

  6. Manuel on June 16th, 2009 23:10

    … and so fast too. ;)

  7. ghost on June 26th, 2009 11:23

    thanks alot man, this worked great

  8. Chris on September 4th, 2009 7:26

    I can’t get this to work in Snow Leopard. Any ideas?

  9. Manuel on September 4th, 2009 12:05

    @Chris
    I’m going to install Snow Leopard next week, so maybe there is another solution.

  10. Mitur Binesderti on September 14th, 2009 3:31

    WHY do they make it so damn hard? Morons.

  11. Lasse on October 10th, 2009 0:22

    This works for me in Snow Leopard no problem.

  12. MB on November 3rd, 2009 12:36

    Excellent… saved me loads of time getting Citrix to run properly for work. THANK YOU!

  13. scot Nery on January 3rd, 2010 19:55

    thank you, but the plist link is a 404

  14. Ben on March 28th, 2010 11:54

    Thanks for the help. Works beautifully!

  15. Francois on October 31st, 2010 1:02

    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

  16. Tom Lazar on January 4th, 2011 4:15

    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/

  17. dsuddya on April 13th, 2011 6:01

    .rar is opened

    LSRiskCategorySafe

    LSRiskCategoryContentTypes

    public.archive

    LSRiskCategoryExtensions

    rar

  18. Patrick Y on July 28th, 2011 8:06

    Works for Safari 5.1 on Mac OS X 10.6.8. Thanks.

  19. sanfar on August 25th, 2011 7:35

    dowload safari

  20. sanfar on August 25th, 2011 7:38

    download

  21. Sabdal on September 19th, 2011 16:39

    Agreed, does NOT work with docx or xlsx. Any thoughts?

  22. Beth on January 6th, 2012 19:54

    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!

Leave a Reply


Captcha
<-- Please fill