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>

There are, however, some restrictions which are apparently designed by Apple: the extensions .rar .7z do not work for example.

Comments

13 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

Leave a Reply