From f9ce5ccd4e2943c77cab03c3bb9ec21fe49f6c9d Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Wed, 14 Jun 2017 22:10:04 +0200
Subject: [PATCH] Use web context of the webview instead of default.

This should not make any difference at the time but we are free to use
custom web context later.
---
 src/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index 5d01268..e54b8de 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1673,6 +1673,7 @@ static WebKitWebView *webview_new(Client *c, WebKitWebView *webview)
 {
     WebKitWebView *new;
     WebKitUserContentManager *ucm;
+    WebKitWebContext *webcontext;
 
     /* create a new webview */
     if (webview) {
@@ -1698,7 +1699,8 @@ static WebKitWebView *webview_new(Client *c, WebKitWebView *webview)
         NULL
     );
 
-    g_signal_connect(webkit_web_context_get_default(), "download-started", G_CALLBACK(on_webctx_download_started), c);
+    webcontext = webkit_web_view_get_context(new);
+    g_signal_connect(webcontext, "download-started", G_CALLBACK(on_webctx_download_started), c);
 
     /* Setup script message handlers. */
     webkit_user_content_manager_register_script_message_handler(ucm, "focus");
-- 
2.20.1