+void
+toggle(Client *c, const Arg *arg)
+{
+ WebKitWebSettings *settings;
+ char *name = (char *)arg->v;
+ gboolean value;
+ Arg a = { .b = FALSE };
+
+ settings = webkit_web_view_get_settings(c->view);
+ g_object_get(G_OBJECT(settings), name, &value, NULL);
+ g_object_set(G_OBJECT(settings), name, !value, NULL);
+
+ reload(c, &a);
+}
+
+void
+togglecookiepolicy(Client *c, const Arg *arg)
+{
+ ++cookiepolicy;
+ cookiepolicy %= strlen(cookiepolicies);
+
+ webkit_cookie_manager_set_accept_policy(
+ webkit_web_context_get_cookie_manager(
+ webkit_web_view_get_context(c->view)),
+ cookiepolicy_get());
+
+ updatetitle(c);
+ /* Do not reload. */
+}
+
+void
+togglegeolocation(Client *c, const Arg *arg)
+{
+ Arg a = { .b = FALSE };
+
+ allowgeolocation ^= 1;
+ reload(c, &a);
+}
+
+void
+twitch(Client *c, const Arg *arg)
+{
+ GtkAdjustment *a;
+ gdouble v;
+
+ a = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(
+ c->scroll));
+
+ v = gtk_adjustment_get_value(a);
+
+ v += arg->i;
+
+ v = MAX(v, 0.0);
+ v = MIN(v, gtk_adjustment_get_upper(a) -
+ gtk_adjustment_get_page_size(a));
+ gtk_adjustment_set_value(a, v);
+}
+
+void
+togglescrollbars(Client *c, const Arg *arg)
+{
+ GtkPolicyType vspolicy;
+ Arg a;
+
+ gtk_scrolled_window_get_policy(GTK_SCROLLED_WINDOW(c->scroll), NULL,
+ &vspolicy);
+
+ if (vspolicy == GTK_POLICY_AUTOMATIC) {
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(c->scroll),
+ GTK_POLICY_NEVER,
+ GTK_POLICY_NEVER);
+ } else {
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(c->scroll),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+ a.i = +1;
+ twitch(c, &a);
+ a.i = -1;
+ twitch(c, &a);
+ }
+}
+
+void
+togglestyle(Client *c, const Arg *arg)
+{
+ enablestyle = !enablestyle;
+ setstyle(c, enablestyle ? getstyle(geturi(c)) : "");
+
+ updatetitle(c);
+}
+
+void
+gettogglestat(Client *c)
+{
+ gboolean value;
+ int p = 0;
+ WebKitWebSettings *settings = webkit_web_view_get_settings(c->view);
+
+ togglestat[p++] = cookiepolicy_set(cookiepolicy_get());
+
+ g_object_get(G_OBJECT(settings), "enable-caret-browsing", &value,
+ NULL);
+ togglestat[p++] = value? 'C': 'c';
+
+ togglestat[p++] = allowgeolocation? 'G': 'g';
+
+ togglestat[p++] = enablediskcache? 'D': 'd';
+
+ g_object_get(G_OBJECT(settings), "auto-load-images", &value, NULL);
+ togglestat[p++] = value? 'I': 'i';
+
+ g_object_get(G_OBJECT(settings), "enable-scripts", &value, NULL);
+ togglestat[p++] = value? 'S': 's';
+
+ g_object_get(G_OBJECT(settings), "enable-plugins", &value, NULL);
+ togglestat[p++] = value? 'V': 'v';
+
+ togglestat[p++] = enablestyle ? 'M': 'm';
+
+ togglestat[p] = '\0';
+}
+
+void
+getpagestat(Client *c)
+{
+ const char *uri = geturi(c);
+
+ if (strstr(uri, "https://") == uri)
+ pagestat[0] = c->sslfailed ? 'U' : 'T';