[hackers] [surf] Add a few configuration options || Quentin Rameau

From: <git_AT_suckless.org>
Date: Tue, 5 Jul 2016 17:33:16 +0200 (CEST)

commit 4c41d363b761999a8af864b4e20218f0625d940f
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Tue Jul 5 17:26:54 2016 +0200
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Tue Jul 5 17:32:44 2016 +0200

    Add a few configuration options
    
    “enable-accelerated-2d-canvas”
    “media-playback-requires-user-gesture”
    “enable-site-specific-quirks”
    
    Lookup those at
    https://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html

diff --git a/config.def.h b/config.def.h
index 23fd05a..6d3135e 100644
--- a/config.def.h
+++ b/config.def.h
_AT_@ -8,6 +8,7 @@ static char *cookiefile = "~/.surf/cookies.txt";
 
 /* Webkit default features */
 static Parameter defconfig[ParameterLast] = {
+ SETB(AcceleratedCanvas, 1),
         SETB(CaretBrowsing, 0),
         SETV(CookiePolicies, "_AT_Aa"),
         SETB(DiskCache, 1),
_AT_@ -20,11 +21,13 @@ static Parameter defconfig[ParameterLast] = {
         SETB(JavaScript, 1),
         SETB(KioskMode, 0),
         SETB(LoadImages, 1),
+ SETB(MediaManualPlay, 0),
         SETB(Plugins, 1),
         SETV(PreferredLanguages, ((char *[]){ NULL })),
         SETB(RunInFullscreen, 0),
         SETB(ScrollBars, 1),
         SETB(ShowIndicators, 1),
+ SETB(SiteQuirks, 1),
         SETB(SpellChecking, 0),
         SETV(SpellLanguages, ((char *[]){ "en_US", NULL })),
         SETB(StrictSSL, 0),
diff --git a/surf.c b/surf.c
index 64c5f5f..7e2b2bd 100644
--- a/surf.c
+++ b/surf.c
_AT_@ -58,6 +58,7 @@ enum {
 };
 
 typedef enum {
+ AcceleratedCanvas,
         CaretBrowsing,
         CookiePolicies,
         DiskCache,
_AT_@ -70,11 +71,13 @@ typedef enum {
         JavaScript,
         KioskMode,
         LoadImages,
+ MediaManualPlay,
         Plugins,
         PreferredLanguages,
         RunInFullscreen,
         ScrollBars,
         ShowIndicators,
+ SiteQuirks,
         SpellChecking,
         SpellLanguages,
         StrictSSL,
_AT_@ -611,6 +614,9 @@ setparameter(Client *c, int refresh, ParamName p, const Arg *a)
         WebKitSettings *s = webkit_web_view_get_settings(c->view);
 
         switch (p) {
+ case AcceleratedCanvas:
+ webkit_settings_set_enable_accelerated_2d_canvas(s, a->b);
+ break;
         case CaretBrowsing:
                 webkit_settings_set_enable_caret_browsing(s, a->b);
                 refresh = 0;
_AT_@ -655,6 +661,9 @@ setparameter(Client *c, int refresh, ParamName p, const Arg *a)
         case LoadImages:
                 webkit_settings_set_auto_load_images(s, a->b);
                 break;
+ case MediaManualPlay:
+ webkit_settings_set_media_playback_requires_user_gesture(s, a->b);
+ break;
         case Plugins:
                 webkit_settings_set_enable_plugins(s, a->b);
                 break;
_AT_@ -672,6 +681,9 @@ setparameter(Client *c, int refresh, ParamName p, const Arg *a)
                 return; /* do not update */
         case ShowIndicators:
                 break;
+ case SiteQuirks:
+ webkit_settings_set_enable_site_specific_quirks(s, a->b);
+ break;
         case SpellChecking:
                 webkit_web_context_set_spell_checking_enabled(
                     webkit_web_view_get_context(c->view), a->b);
_AT_@ -900,6 +912,9 @@ newview(Client *c, WebKitWebView *rv)
                    "enable-html5-local-storage", curconfig[DiskCache].val.b,
                    "enable-javascript", curconfig[JavaScript].val.b,
                    "enable-plugins", curconfig[Plugins].val.b,
+ "enable-accelerated-2d-canvas", curconfig[AcceleratedCanvas].val.b,
+ "enable-site-specific-quirks", curconfig[SiteQuirks].val.b,
+ "media-playback-requires-user-gesture", curconfig[MediaManualPlay].val.b,
                    NULL);
 /* For mor interesting settings, have a look at
  * http://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html */
Received on Tue Jul 05 2016 - 17:33:16 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 05 2016 - 17:36:23 CEST