From 5a9dd00af4e2791c54b106b76e0d524125a132dd Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 01 Nov 2017 11:41:36 -0400 Subject: mq_web_view_normal_scheme_methods.initialize(): Use MqSettings with no overrides Otherwise, if a user navigates to a normal-scheme page from a source view, the JS override will remain. --- (limited to 'src/web-view-schemes') diff --git a/src/web-view-schemes/normal.c b/src/web-view-schemes/normal.c index 84ecb50..03cdf0e 100644 --- a/src/web-view-schemes/normal.c +++ b/src/web-view-schemes/normal.c @@ -30,9 +30,12 @@ #include "../application.h" #include "../config.h" #include "../notebook.h" +#include "../settings.h" #include "../tab-page.h" #include "../web-view.h" +static MqSettings *settings = NULL; + static gboolean match_uri(const gchar *uri) { @@ -42,9 +45,25 @@ match_uri(const gchar *uri) } static void -initialize(MqWebView G_GNUC_UNUSED *web_view, - MqWebViewScheme G_GNUC_UNUSED *scheme, const gchar G_GNUC_UNUSED *uri) +init_settings(MqConfig *config) +{ + if (settings) { + return; + } + + settings = mq_settings_new(); + mq_settings_set_web_context(settings, webkit_web_context_get_default()); + mq_settings_connect_config(settings, config); +} + +static void +initialize(MqWebView *web_view, MqWebViewScheme G_GNUC_UNUSED *scheme, + const gchar G_GNUC_UNUSED *uri) { + init_settings(mq_web_view_get_config(web_view)); + + webkit_web_view_set_settings(WEBKIT_WEB_VIEW(web_view), + WEBKIT_SETTINGS(settings)); } static void -- cgit v0.9.1