From de8924a96928e3eed5b74edf623cda92b3f4a894 Mon Sep 17 00:00:00 2001 From: jun7 Date: Fri, 19 Mar 2021 20:36:22 +0900 Subject: [PATCH] Add itp for #47 --- general.c | 1 + main.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/general.c b/general.c index f305078..0770a9b 100644 --- a/general.c +++ b/general.c @@ -134,6 +134,7 @@ static Conf dconf[] = { {"all" , "winheight" , "1000"}, {"all" , "zoom" , "1.000"}, {"all" , "ignoretlserr" , "false"}, + {"all" , "itp" , "false"}, {"all" , "histviewsize" , "99"}, {"all" , "histimgs" , "99"}, {"all" , "histimgsize" , "222"}, diff --git a/main.c b/main.c index 968d3ed..a5278b0 100644 --- a/main.c +++ b/main.c @@ -1048,10 +1048,16 @@ static void checkconf(const char *mp) initconf(new); if (ctx) + { webkit_web_context_set_tls_errors_policy(ctx, confbool("ignoretlserr") ? WEBKIT_TLS_ERRORS_POLICY_IGNORE : WEBKIT_TLS_ERRORS_POLICY_FAIL); +#if WEBKIT_MAJOR_VERSION > 2 || WEBKIT_MINOR_VERSION > 28 + webkit_website_data_manager_set_itp_enabled( + webkit_web_context_get_website_data_manager(ctx), confbool("itp")); +#endif + } if (!wins) return; @@ -4663,6 +4669,12 @@ Win *newwin(const char *uri, Win *cbwin, Win *caller, int back) if (confbool("ignoretlserr")) webkit_web_context_set_tls_errors_policy(ctx, WEBKIT_TLS_ERRORS_POLICY_IGNORE); + +#if WEBKIT_MAJOR_VERSION > 2 || WEBKIT_MINOR_VERSION > 28 + if (confbool("itp")) + webkit_website_data_manager_set_itp_enabled( + webkit_web_context_get_website_data_manager(ctx), true); +#endif } WebKitUserContentManager *cmgr = webkit_user_content_manager_new(); win->kito = cbwin ?