# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1680591980 0 # Node ID fed8a986d565e9b5de1aee634d084e1a22db302d # Parent dfab2dfa9bc144ff3ff37e798356613ac68a017b GTK3: Fix compiling with pre-2.22 WebKit2GTK. Missing exception variable, so just introduce a NULL one. Also the WebKitUserContentManager is NULL, causing it not to work. So make one during widget creation, allowing proper function. Might want to do this in the GTK4 code too just in case. diff -r dfab2dfa9bc1 -r fed8a986d565 gtk3/dw.c --- a/gtk3/dw.c Tue Apr 04 01:08:14 2023 +0000 +++ b/gtk3/dw.c Tue Apr 04 07:06:20 2023 +0000 @@ -1340,11 +1340,12 @@ #else context = webkit_javascript_result_get_global_context(js_result); value = webkit_javascript_result_get_value(js_result); - if (JSValueIsString(context, value)) + if(JSValueIsString(context, value)) { JSStringRef js_str_value; gchar *str_value; gsize str_length; + void *exception = NULL; js_str_value = JSValueToStringCopy(context, value, NULL); str_length = JSStringGetMaximumUTF8CStringSize(js_str_value); @@ -12057,12 +12058,18 @@ WebKitWebView *web_view; #ifdef USE_WEBKIT2 WebKitSettings *settings; + WebKitUserContentManager *manager; #else WebKitWebSettings *settings; #endif DW_MUTEX_LOCK; +#ifdef USE_WEBKIT2 + manager = webkit_user_content_manager_new(); + web_view = (WebKitWebView *)webkit_web_view_new_with_user_content_manager(manager); +#else web_view = (WebKitWebView *)webkit_web_view_new(); +#endif /* WebKit2 no longer requires a scrolled window... * So only create a scrolled window and pack it in older versions. */