if (scriptdir != NULL) {
while ((entry = g_dir_read_name(scriptdir)) != NULL) {
path = g_build_filename(base, entry, NULL);
+ char *jscmd = malloc(strlen(path) + 36);
+ sprintf(jscmd, "console.log(\"Running userscript %s\");", path);
if (g_str_has_suffix(path, ".js")) {
if (g_file_get_contents(path, &contents, NULL, NULL)) {
+ webkit_web_view_run_javascript(web_view, jscmd, NULL, NULL, NULL);
webkit_web_view_run_javascript(web_view, contents, NULL, NULL, NULL);
g_free(contents);
+ g_free(jscmd);
}
}
g_free(path);