Add warning when web extension could not be found.
authorDaniel Carl <danielcarl@gmx.de>
Sat, 2 Dec 2017 22:42:02 +0000 (23:42 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Sat, 2 Dec 2017 22:46:41 +0000 (23:46 +0100)
The warning is only shown if compiled with DEBUG. Hope this will helps
users and package managers to check the compilation or installation.

src/main.c

index f71442d..03575a3 100644 (file)
@@ -1011,6 +1011,14 @@ static void on_webctx_init_web_extension(WebKitWebContext *webctx, gpointer data
     const char *name;
     GVariant *vdata;
 
+#ifdef DEBUG
+    char *extension = g_build_filename(EXTENSIONDIR,  "webext_main.so", NULL);
+    if (!g_file_test(extension, G_FILE_TEST_IS_REGULAR)) {
+        g_warning("Cannot access web extension %s", extension);
+    }
+    g_free(extension);
+#endif
+
     /* Setup the extension directory. */
     webkit_web_context_set_web_extensions_directory(webctx, EXTENSIONDIR);