diff options
-rw-r--r-- | src/web-view-schemes/normal.c | 23 |
1 files changed, 21 insertions, 2 deletions
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 |