From 7939dc1bf1fe0ba752667a0b05db52e50184d3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Forysiuk?= Date: Fri, 4 Feb 2011 19:43:05 +0100 Subject: [PATCH] Try matching URI by extension first in script/ style infobar Fallback to hostname if that fails --- extensions/addons.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/addons.c b/extensions/addons.c index 50cff0e3..a08983ec 100644 --- a/extensions/addons.c +++ b/extensions/addons.c @@ -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 (),