if BUILD_FANCY_PLUGIN
plugin_LTLIBRARIES = fancy.la
-webextension_LTLIBRARIES = libfancywebextension.la
+webextension_LTLIBRARIES = fancywebextension.la
endif
fancy_la_LDFLAGS = \
$(WEBKIT_CFLAGS) \
$(LIBSOUP_GNOME_CFLAGS) \
$(CURL_CFLAGS) \
- -DFANCY_WEB_EXTENSIONS_DIR=\""$(pkglibdir)/plugins/web_extensions"\"
+ -DFANCY_WEB_EXTENSIONS_DIR=\""$(pkglibdir)/plugins/web_extensions"\" \
+ -DFANCY_WEB_EXTENSION_FILE=\""fancywebextension"\"
fancy_la_SOURCES = \
fancy_prefs.c \
fancy_viewer.c \
fancy_viewer.h
-libfancywebextension_la_SOURCES = fancy_web_extension.c
-libfancywebextension_la_CFLAGS = $(WEBKIT_CFLAGS)
-libfancywebextension_la_LIBADD = $(WEBKIT_LIBS)
-libfancywebextension_la_LDFLAGS = -module -avoid-version -no-undefined
+fancywebextension_la_SOURCES = fancy_web_extension.c
+fancywebextension_la_CFLAGS = $(WEBKIT_CFLAGS)
+fancywebextension_la_LIBADD = $(WEBKIT_LIBS)
+fancywebextension_la_LDFLAGS = -module -avoid-version -no-undefined
.PHONY: test
}
g_free(directory);
+ gchar *web_ext_filename = g_strconcat(FANCY_WEB_EXTENSION_FILE,
+ ".",
+ G_MODULE_SUFFIX,
+ NULL);
+ gchar *web_ext_file = g_build_path(G_DIR_SEPARATOR_S,
+ FANCY_WEB_EXTENSIONS_DIR,
+ web_ext_filename,
+ NULL);
+
+ if (!g_file_test(web_ext_file, G_FILE_TEST_EXISTS)) {
+ *error = g_strdup_printf(_("Failed to find the companion WebKit extension %s"), web_ext_file);
+ g_free(web_ext_filename);
+ g_free(web_ext_file);
+ return -1;
+ }
+
+ g_free(web_ext_filename);
+ g_free(web_ext_file);
+
webkit_web_context_set_web_extensions_directory(webkit_web_context_get_default(),
FANCY_WEB_EXTENSIONS_DIR);