]> spindle.queued.net Git - midori/commitdiff
Try matching URI by extension first in script/ style infobar
authorPaweł Forysiuk <tuxator@o2.pl>
Fri, 4 Feb 2011 18:43:05 +0000 (19:43 +0100)
committerChristian Dywan <christian@twotoasts.de>
Tue, 8 Feb 2011 23:14:27 +0000 (00:14 +0100)
Fallback to hostname if that fails

extensions/addons.c

index 50cff0e314f1b6fd99c76191e5497e0a71762ede..a08983ecc3145077e11d4c914c52c7af8d2cfb28 100644 (file)
@@ -119,7 +119,11 @@ addons_install_response (GtkWidget*  infobar,
             filename = NULL;
             folder = NULL;
 
-            if (!g_strcmp0 (hostname, "userscripts.org"))
+            if (g_str_has_suffix (uri, ".user.js"))
+                folder = "scripts";
+            else if (g_str_has_suffix (uri, ".user.css"))
+                folder = "styles";
+            else if (!g_strcmp0 (hostname, "userscripts.org"))
             {
                 gchar* script_id;
                 const gchar* js_script;
@@ -182,10 +186,6 @@ addons_install_response (GtkWidget*  infobar,
                 }
             }
 
-            if (g_str_has_suffix (uri, ".user.js"))
-                folder = "scripts";
-            else if (g_str_has_suffix (uri, ".user.css"))
-                folder = "styles";
             if (!filename)
                 filename = g_path_get_basename (uri);
             path = g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (),