diff -ur docshell-orig/base/nsDocShell.cpp docshell/base/nsDocShell.cpp
--- docshell-orig/base/nsDocShell.cpp	2005-01-09 15:24:14.368981208 +0100
+++ docshell/base/nsDocShell.cpp	2005-01-09 15:22:36.533854408 +0100
@@ -161,6 +161,12 @@
 
 #include "nsPluginError.h"
 
+// for Gnome desktop file support
+#ifdef MOZ_WIDGET_GTK2
+#include "nsILineInputStream.h"
+#include "nsReadableUtils.h"
+#endif
+
 static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
 static NS_DEFINE_CID(kSimpleURICID, NS_SIMPLEURI_CID);
 static NS_DEFINE_CID(kDocumentCharsetInfoCID, NS_DOCUMENTCHARSETINFO_CID);
@@ -571,7 +577,72 @@
 
 //*****************************************************************************
 // nsDocShell::nsIDocShell
-//*****************************************************************************   
+//*****************************************************************************
+
+#ifdef MOZ_WIDGET_GTK2
+PRBool
+CheckGnomeDesktopFile (nsIURI * aURI,
+                       nsIURI ** dURI)
+{
+    static const char kHeader[] = "[Desktop Entry]";
+    static const char kTypeIsLink[] = "Type=Link";
+    static const char kURL[] = "URL=";
+
+    nsresult rv;
+
+    NS_ENSURE_ARG(aURI);
+    NS_ENSURE_ARG_POINTER(dURI);
+
+    PRBool isLocal = PR_FALSE;
+    if (!NS_SUCCEEDED (aURI->SchemeIs("file", &isLocal)) || !isLocal) {
+       return PR_FALSE;
+    }
+
+    nsCAutoString spec;
+    rv = aURI->GetSpec(spec);
+    if (NS_FAILED(rv)) return PR_FALSE;
+    
+    nsCOMPtr<nsIFile> aFile;
+    rv = NS_GetFileFromURLSpec(spec, getter_AddRefs(aFile));
+    if (NS_FAILED(rv)) return PR_FALSE;
+
+    nsCOMPtr<nsIInputStream> inStr;
+    rv = NS_NewLocalFileInputStream(getter_AddRefs(inStr), aFile);
+    if (NS_FAILED(rv)) return PR_FALSE;
+
+    nsCOMPtr<nsILineInputStream> linStr (do_QueryInterface(inStr));
+    if (!linStr) return PR_FALSE;
+
+    nsCAutoString buffer;
+    PRBool isMore = PR_TRUE, gotHeader = PR_FALSE, gotType = PR_FALSE;
+    while (isMore && NS_SUCCEEDED(linStr->ReadLine(buffer, &isMore))) {
+       if (buffer.IsEmpty()) {
+          continue;
+       }
+
+       if (!gotHeader) {
+          if (Substring(buffer, 0, strlen(kHeader)).EqualsLiteral(kHeader)) {
+             gotHeader = PR_TRUE;
+          } else {
+             return PR_FALSE; // First line must be header
+          }
+       }
+
+       if (!gotType) {
+          gotType = buffer.EqualsLiteral(kTypeIsLink);
+       } else {
+          if (Substring(buffer, 0, strlen(kURL)).EqualsLiteral(kURL)) {
+             NS_NewURI(dURI, Substring(buffer, strlen(kURL), buffer.Length()));
+	     
+	     return PR_TRUE;
+          }
+       }
+    }
+
+    return PR_FALSE;
+}
+#endif
+    
 NS_IMETHODIMP
 nsDocShell::LoadURI(nsIURI * aURI,
                     nsIDocShellLoadInfo * aLoadInfo,
@@ -590,6 +661,17 @@
 
     NS_ENSURE_ARG(aURI);
 
+#ifdef MOZ_WIDGET_GTK2
+    PRBool hasDesktopFileURI;
+    nsCOMPtr<nsIURI> desktopFileURI;
+
+    hasDesktopFileURI = CheckGnomeDesktopFile(aURI, getter_AddRefs(desktopFileURI));
+    if (hasDesktopFileURI) {
+        LoadURI(desktopFileURI, aLoadInfo, aLoadFlags, firstParty);
+	return NS_OK;
+    }
+#endif
+
     // Extract the info from the DocShellLoadInfo struct...
     if (aLoadInfo) {
         aLoadInfo->GetReferrer(getter_AddRefs(referrer));
