surf

Surf web browser.
git clone git://r-36.net/surf
Log | Files | Refs | README | LICENSE

commit cef886fc3a6bb4a22fd8109c85d69ced25df9283
parent 3276d6ebcf08c4c0ad73d7fb37a2f018e0eb3d1c
Author: Christoph Lohmann <20h@r-36.net>
Date:   Thu, 20 Apr 2017 21:47:41 +0200

Adapting the new flags to newclient().

Diffstat:
surf.c | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 80 insertions(+), 14 deletions(-)

diff --git a/surf.c b/surf.c @@ -1152,38 +1152,104 @@ void newwindow(Client *c, const Arg *arg, gboolean noembed) { guint i = 0; - const char *cmd[18], *uri; + const char *cmd[28], *uri; const Arg a = { .v = (void *)cmd }; - char tmp[64]; + char tmp[64], ztmp[6]; cmd[i++] = argv0; - cmd[i++] = "-a"; - cmd[i++] = cookiepolicies; - if (!enablescrollbars) + + if (cookiepolicies != NULL) { + cmd[i++] = "-a"; + cmd[i++] = cookiepolicies; + } + + if (enablescrollbars) + cmd[i++] = "-B"; + else cmd[i++] = "-b"; + + if (cookiefile != NULL) { + cmd[i++] = "-c"; + cmd[i++] = cookiefile; + } + + if (enablediskcache) + cmd[i++] = "-D"; + else + cmd[i++] = "-d"; + if (embed && !noembed) { cmd[i++] = "-e"; snprintf(tmp, LENGTH(tmp), "%u", (int)embed); cmd[i++] = tmp; } - if (!allowgeolocation) + + if (runinfullscreen) + cmd[i++] = "-F"; + else + cmd[i++] = "-f"; + + if (allowgeolocation) + cmd[i++] = "-G"; + else cmd[i++] = "-g"; - if (!loadimages) + + if (loadimages) + cmd[i++] = "-I"; + else cmd[i++] = "-i"; + if (kioskmode) + cmd[i++] = "-K"; + else cmd[i++] = "-k"; - if (!enableplugins) + + if (enablestyle) + cmd[i++] = "-M"; + else + cmd[i++] = "-m"; + + if (enableinspector) + cmd[i++] = "-N"; + else + cmd[i++] = "-n"; + + if (enableplugins) + cmd[i++] = "-P"; + else cmd[i++] = "-p"; - if (!enablescripts) + + if (scriptfile != NULL) { + cmd[i++] = "-r"; + cmd[i++] = scriptfile; + } + + if (enablescripts) + cmd[i++] = "-S"; + else cmd[i++] = "-s"; + + if (strictssl) + cmd[i++] = "-T"; + else + cmd[i++] = "-t"; + + if (useragent != NULL) { + cmd[i++] = "-u"; + cmd[i++] = useragent; + } + if (showxid) cmd[i++] = "-x"; - if (enablediskcache) - cmd[i++] = "-D"; - cmd[i++] = "-c"; - cmd[i++] = cookiefile; + + if (zoomlevel != 1.0) { + cmd[i++] = "-z"; + snprintf(ztmp, LENGTH(ztmp), "%.1f", zoomlevel); + cmd[i++] = ztmp; + } + cmd[i++] = "--"; - uri = arg->v ? (char *)arg->v : c->linkhover; + uri = arg->v? (char *)arg->v : c->linkhover; if (uri) cmd[i++] = uri; cmd[i++] = NULL;