Use web context of the webview instead of default.
authorDaniel Carl <danielcarl@gmx.de>
Wed, 14 Jun 2017 20:10:04 +0000 (22:10 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Wed, 14 Jun 2017 20:10:04 +0000 (22:10 +0200)
This should not make any difference at the time but we are free to use
custom web context later.

src/main.c

index 5d01268..e54b8de 100644 (file)
@@ -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");