Skip to content

Commit

Permalink
Log javascript console messages to the trace file
Browse files Browse the repository at this point in the history
  • Loading branch information
gjanssens committed Feb 1, 2017
1 parent eac7987 commit 6a5a850
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/html/gnc-html-webkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,17 @@ static void impl_webkit_cancel( GncHtml* self );
static void impl_webkit_set_parent( GncHtml* self, GtkWindow* parent );
static void impl_webkit_default_zoom_changed(gpointer prefs, gchar *pref, gpointer user_data);

static gboolean
webkit_console_msg_cb (GtkWidget* web_view,
const gchar* message,
guint line,
const gchar* source_id,
GncHtmlWebkit* view)
{
PWARN ("JS: %s (%u): %s", source_id, line, message);
return TRUE;
}

static void
gnc_html_webkit_init( GncHtmlWebkit* self )
{
Expand Down Expand Up @@ -173,6 +184,10 @@ gnc_html_webkit_init( GncHtmlWebkit* self )
G_CALLBACK(webkit_on_url_cb),
self );

g_signal_connect( priv->web_view, "console-message",
G_CALLBACK(webkit_console_msg_cb),
self);

#if 0
g_signal_connect( priv->html, "set_base",
G_CALLBACK(gnc_html_set_base_cb),
Expand Down

0 comments on commit 6a5a850

Please sign in to comment.