[devhelp/ebassi/gidocgen: 5/6] Set the User-Agent




commit a75631e515c3da633889c1cd548ae8f1dae16bab
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Apr 7 13:22:37 2021 +0100

    Set the User-Agent
    
    We should allow modern API references to detect when running under
    DevHelp, and update their style in ways that improve integration.
    
    See: #28

 devhelp/dh-web-view.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/devhelp/dh-web-view.c b/devhelp/dh-web-view.c
index 9563b700..782a8ba8 100644
--- a/devhelp/dh-web-view.c
+++ b/devhelp/dh-web-view.c
@@ -488,6 +488,12 @@ dh_web_view_constructed (GObject *object)
         /* Plugins are always disabled with WebKit >= 2.32 */
         webkit_settings_set_enable_plugins (webkit_settings, FALSE);
 #endif
+
+        /* Set the User-Agent to something tools can match */
+        webkit_settings_set_user_agent_with_application_details (webkit_settings,
+                                                                 "DevHelp",
+                                                                 LIBDEVHELP_API_VERSION);
+
         if (view->priv->profile == NULL)
                 set_profile (view, dh_profile_get_default ());
 


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