summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorugla <ugla@u8.is>2021-12-17 12:07:33 +0100
committerrafa_99 <raroma09@gmail.com>2022-01-01 20:30:39 +0000
commit7ce78b9571ac6c4a5d8a17957528849eebafb480 (patch)
treed97317b53c6efc7c9e40af49f13be82ae1e5fdf2
parent95afb316ab196d09ef68d79d4a74223636906246 (diff)
Add version check around ITP option
-rw-r--r--src/setting.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/setting.c b/src/setting.c
index 12d7704..e081757 100644
--- a/src/setting.c
+++ b/src/setting.c
@@ -108,7 +108,9 @@ void setting_init(Client *c)
setting_add(c, "html5-local-storage", TYPE_BOOLEAN, &on, webkit, 0, "enable-html5-local-storage");
setting_add(c, "hyperlink-auditing", TYPE_BOOLEAN, &off, webkit, 0, "enable-hyperlink-auditing");
setting_add(c, "images", TYPE_BOOLEAN, &on, webkit, 0, "auto-load-images");
+#if WEBKIT_CHECK_VERSION(2, 30, 0)
setting_add(c, "intelligent-tracking-prevention", TYPE_BOOLEAN, &off, intelligent_tracking_prevention, 0, NULL);
+#endif
setting_add(c, "javascript-can-access-clipboard", TYPE_BOOLEAN, &off, webkit, 0, "javascript-can-access-clipboard");
setting_add(c, "javascript-can-open-windows-automatically", TYPE_BOOLEAN, &off, webkit, 0, "javascript-can-open-windows-automatically");
#if WEBKIT_CHECK_VERSION(2, 24, 0)
@@ -568,6 +570,7 @@ static int geolocation(Client *c, const char *name, DataType type, void *value,
return CMD_SUCCESS;
}
+#if WEBKIT_CHECK_VERSION(2, 30, 0)
static int intelligent_tracking_prevention(Client *c, const char *name, DataType type, void *value, void *data)
{
WebKitWebContext *ctx = webkit_web_view_get_context(c->webview);
@@ -575,6 +578,7 @@ static int intelligent_tracking_prevention(Client *c, const char *name, DataType
webkit_website_data_manager_set_itp_enabled(manager, *(gboolean*)value);
return CMD_SUCCESS;
}
+#endif
/* This needs to be called before the window is shown for the best chance of
* success, but it may be called at any time.