[gnome-online-accounts] webview: Address the loss of SoupSession:accept-language-auto=TRUE



commit c86aa713f2fde6133b7b5303c30530f8f8259ed4
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Aug 8 12:35:20 2017 +0200

    webview: Address the loss of SoupSession:accept-language-auto=TRUE
    
    With WebKit1, the Accept-Language header could be set for every
    request based on g_get_language_names by using the SoupSession's
    accept-language-auto property. This was lost during the port to
    WebKit2.
    
    Since WebKit2 doesn't expose its internal SoupSession, the same
    functionality is now implemented using g_get_language_names and
    webkit_web_context_set_preferred_languages.
    
    Fallout from 81434a02fe638d982afdbe6cd9e5b75ddfdf238f
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758716

 src/goabackend/goawebview.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/goabackend/goawebview.c b/src/goabackend/goawebview.c
index c9a315b..7a28e51 100644
--- a/src/goabackend/goawebview.c
+++ b/src/goabackend/goawebview.c
@@ -272,12 +272,15 @@ goa_web_view_constructed (GObject *object)
 {
   GoaWebView *self = GOA_WEB_VIEW (object);
   WebKitCookieManager *cookie_manager;
+  const gchar *const *language_names;
   gchar *jar_dir;
   gchar *jar_file;
 
   G_OBJECT_CLASS (goa_web_view_parent_class)->constructed (object);
 
   self->context = webkit_web_context_new ();
+  language_names = g_get_language_names ();
+  webkit_web_context_set_preferred_languages (self->context, language_names);
   g_signal_connect_swapped (self->context,
                             "initialize-web-extensions",
                             G_CALLBACK (web_view_initialize_web_extensions_cb),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]