}
static void
-katze_http_auth_attach (SoupSessionFeature* feature,
- SoupSession* session)
+katze_http_auth_session_request_queued_cb (SoupSession* session,
+ SoupMessage* msg,
+ gpointer data)
{
+ /* WebKit has its own authentication dialog in recent versions.
+ We want only one, and we choose our own to have localization. */
+ GType type = g_type_from_name ("WebKitSoupAuthDialog");
+ if (type)
+ soup_session_remove_feature_by_type (session, type);
+
g_signal_connect (session, "authenticate",
G_CALLBACK (katze_http_auth_session_authenticate_cb), NULL);
+ g_signal_handlers_disconnect_by_func (session,
+ katze_http_auth_session_request_queued_cb, NULL);
+}
+
+static void
+katze_http_auth_attach (SoupSessionFeature* feature,
+ SoupSession* session)
+{
+ g_signal_connect (session, "request-queued",
+ G_CALLBACK (katze_http_auth_session_request_queued_cb), NULL);
}
static void
{
g_signal_handlers_disconnect_by_func (session,
katze_http_auth_session_authenticate_cb, NULL);
+ g_signal_handlers_disconnect_by_func (session,
+ katze_http_auth_session_request_queued_cb, NULL);
}
static void
g_signal_connect (settings, "notify::ident-string",
G_CALLBACK (soup_session_settings_notify_ident_string_cb), object);
- /* Only add the Auth feature if WebKit didn't already */
- if (!g_signal_has_handler_pending (session,
- g_signal_lookup ("authenticate", SOUP_TYPE_SESSION), 0, FALSE))
- soup_session_add_feature_by_type (session, KATZE_TYPE_HTTP_AUTH);
+ soup_session_add_feature_by_type (session, KATZE_TYPE_HTTP_AUTH);
midori_soup_session_debug (session);
feature = g_object_new (KATZE_TYPE_HTTP_COOKIES, NULL);