How to make Chromium/Chrome open magnet links in Linux Mint

Many torrent sites like The Pirate Bay are now using magnet links. However, if you click on the magnet links when using Chromium or Chrome, you will have this dialog box but when nothing happens when you click on the button "Launch Application":

chrome chromium browser magnet links Linux

To make Chromium/ Chrome open magnet links with Transmission in Linux Mint, just open the terminal and run the following three commands:
 gconftool-2 -t string -s /desktop/gnome/url-handlers/magnet/command "transmission %s"  

 gconftool-2 -s /desktop/gnome/url-handlers/magnet/needs_terminal false -t bool  

 gconftool-2 -t bool -s /desktop/gnome/url-handlers/magnet/enabled true  

Next, edit the file xdg-open. Just use your favorite text editor, in MATE, the command will be:
 sudo pluma /usr/bin/xdg-open  

When the file is open, search for the following lines ( start at line #300 in my case):
 #--------------------------------------  
 # Checks for known desktop environments  
 # set variable DE to the desktop environments name, lowercase  
 detectDE()  
 {  
   if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;  
   elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;  
   elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;  
   elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;  
   elif [ x"$DESKTOP_SESSION" = x"LXDE" ]; then DE=lxde;  
   else DE=""  
   fi  
 }  

Replace ( you can just comment out for back-up purpose) everything between the two braces with "DE=gnome;", the file should look like this:
 #--------------------------------------  
 # Checks for known desktop environments  
 # set variable DE to the desktop environments name, lowercase  
 detectDE()  
 {  
 DE=gnome;  
 }  

That's this. From now, when you click on a magnet link on Chromium/Chrome, Transmission will be launched.
linux tips and tricks