Index: mozilla-embed-single.cpp
===================================================================
--- mozilla-embed-single.cpp	(revision 6968)
+++ mozilla-embed-single.cpp	(working copy)
@@ -312,24 +312,61 @@
 	}
 }
 
+static GList *
+mozilla_init_plugin_add_unique_path (GList *list,
+				     const char *path)
+{
+	GList *l;
+	char *canon;
+
+	if (path == NULL)
+		return list;
+
+	canon = gnome_vfs_make_path_name_canonical (path);
+	for (l = list; l != NULL; l = l->next) {
+		if (g_str_equal (list->data, canon) != FALSE) {
+			/* The path is already in the list */
+			g_free (canon);
+			return list;
+		}
+	}
+	return g_list_prepend (list, canon);
+}
+
 static void
 mozilla_init_plugin_path ()
 {
+	GList *list, *l;
+	GString *path;
 	const char *user_path;
 	char *new_path;
 
-	user_path = g_getenv ("MOZ_PLUGIN_PATH");
-	new_path = g_strconcat (user_path ? user_path : "",
-				user_path ? ":" : "",
-				MOZILLA_PREFIX "/lib/mozilla/plugins"
-				":" MOZILLA_HOME "/plugins",
+	list = NULL;
+	list = mozilla_init_plugin_add_unique_path (list,
+						    g_getenv ("MOZ_PLUGIN_PATH"));
+	list = mozilla_init_plugin_add_unique_path (list,
+						    MOZILLA_PREFIX "/lib/mozilla/plugins");
+	list = mozilla_init_plugin_add_unique_path (list,
+						    MOZILLA_HOME "/plugins");
+	list = mozilla_init_plugin_add_unique_path (list,
+						    MOZILLA_NATIVE_PLUGINSDIR);
 #ifdef HAVE_PRIVATE_PLUGINS
-				":" PLUGINDIR,
+	list = mozilla_init_plugin_add_unique_path (list, PLUGINDIR);
 #endif
-				(char *) NULL);
 
-	g_setenv ("MOZ_PLUGIN_PATH", new_path, TRUE);
-	g_free (new_path);
+	list = g_list_reverse (list);
+	path = g_string_new (list->data);
+	g_free (list->data);
+	l = list->next;
+	for (; l != NULL; l = l->next) {
+		path = g_string_append_c (path, ':');
+		path = g_string_append (path, l->data);
+		g_free (l->data);
+	}
+	g_list_free (list);
+
+	g_setenv ("MOZ_PLUGIN_PATH", path->str, TRUE);
+	g_string_free (path, TRUE);
 }
 
 static void
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 6968)
+++ Makefile.am	(working copy)
@@ -144,6 +144,7 @@
 	-DPLUGINDIR=\"$(libdir)/epiphany/$(EPIPHANY_MAJOR)/plugins\"		\
 	-DMOZILLA_HOME=\"$(MOZILLA_HOME)\"	\
 	-DMOZILLA_PREFIX=\"$(MOZILLA_PREFIX)\"	\
+	-DMOZILLA_NATIVE_PLUGINSDIR=\"$(libdir)/mozilla/plugins\"		\
 	-DUA_VERSION=\"$(EPIPHANY_UA_VERSION)\"	\
 	-DALLOW_PRIVATE_API			\
 	$(AM_CPPFLAGS)
