summaryrefslogtreecommitdiffstats
path: root/src/web-view-schemes
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-11-01 11:41:36 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-11-01 11:41:36 (EDT)
commit5a9dd00af4e2791c54b106b76e0d524125a132dd (patch)
tree68d68f453d45a65f3eb68e8439d2da271c1aca8f /src/web-view-schemes
parent573a8cc72599ec460d390b7bb1d896b6af269a6b (diff)
downloadmarquee-5a9dd00af4e2791c54b106b76e0d524125a132dd.zip
marquee-5a9dd00af4e2791c54b106b76e0d524125a132dd.tar.gz
marquee-5a9dd00af4e2791c54b106b76e0d524125a132dd.tar.bz2
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.
Diffstat (limited to 'src/web-view-schemes')
-rw-r--r--src/web-view-schemes/normal.c23
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