Add support for configuring plugins directories

This commit is contained in:
Quentin Rameau 2019-03-04 11:43:25 +01:00
parent 8d5e2b3a40
commit 6850365d7c
3 changed files with 12 additions and 2 deletions

View file

@ -6,6 +6,11 @@ static char *styledir = "~/.surf/styles/";
static char *certdir = "~/.surf/certificates/"; static char *certdir = "~/.surf/certificates/";
static char *cachedir = "~/.surf/cache/"; static char *cachedir = "~/.surf/cache/";
static char *cookiefile = "~/.surf/cookies.txt"; static char *cookiefile = "~/.surf/cookies.txt";
static char **plugindirs = (char*[]){
"~/.surf/plugins/",
LIBPREFIX "/mozilla/plugins/",
NULL
};
/* Webkit default features */ /* Webkit default features */
/* Highest priority value will be used. /* Highest priority value will be used.

View file

@ -22,8 +22,9 @@ INCS = $(X11INC) $(GTKINC)
LIBS = $(X11LIB) $(GTKLIB) -lgthread-2.0 LIBS = $(X11LIB) $(GTKLIB) -lgthread-2.0
# flags # flags
CPPFLAGS = -DVERSION=\"$(VERSION)\" -DWEBEXTDIR=\"$(LIBDIR)\" \ CPPFLAGS = -DVERSION=\"$(VERSION)\" -DGCR_API_SUBJECT_TO_CHANGE \
-D_DEFAULT_SOURCE -DGCR_API_SUBJECT_TO_CHANGE -DLIBPREFIX=\"$(LIBPREFIX)\" -DWEBEXTDIR=\"$(LIBDIR)\" \
-D_DEFAULT_SOURCE
SURFCFLAGS = -fPIC $(INCS) $(CPPFLAGS) SURFCFLAGS = -fPIC $(INCS) $(CPPFLAGS)
WEBEXTCFLAGS = -fPIC $(WEBEXTINC) WEBEXTCFLAGS = -fPIC $(WEBEXTINC)

4
surf.c
View file

@ -1161,6 +1161,10 @@ newview(Client *c, WebKitWebView *rv)
webkit_web_context_set_cache_model(context, webkit_web_context_set_cache_model(context,
curconfig[DiskCache].val.i ? WEBKIT_CACHE_MODEL_WEB_BROWSER : curconfig[DiskCache].val.i ? WEBKIT_CACHE_MODEL_WEB_BROWSER :
WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER); WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER);
/* plugins directories */
for (; *plugindirs; ++plugindirs)
webkit_web_context_set_additional_plugins_directory(
context, *plugindirs);
/* Currently only works with text file to be compatible with curl */ /* Currently only works with text file to be compatible with curl */
webkit_cookie_manager_set_persistent_storage(cookiemanager, webkit_cookie_manager_set_persistent_storage(cookiemanager,