|
|
|
@ -1914,36 +1914,21 @@ void
|
|
|
|
|
web_page_console_message_sent_cb(WebKitWebPage *web_page, |
|
|
|
|
WebKitConsoleMessage *console_message, |
|
|
|
|
gpointer user_data) { |
|
|
|
|
WebKitConsoleMessageLevel msg_level; |
|
|
|
|
WebKitConsoleMessageSource msg_source; |
|
|
|
|
WebKitDOMDOMWindow *dom_window; |
|
|
|
|
WebKitDOMDocument *dom_document; |
|
|
|
|
const gchar *msg_text; |
|
|
|
|
gboolean is_error, is_from_javascript, is_exception; |
|
|
|
|
|
|
|
|
|
msg_level = webkit_console_message_get_level(console_message); |
|
|
|
|
is_error = WEBKIT_CONSOLE_MESSAGE_LEVEL_ERROR == msg_level; |
|
|
|
|
|
|
|
|
|
if (! is_error) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
msg_source = webkit_console_message_get_source(console_message); |
|
|
|
|
is_from_javascript = WEBKIT_CONSOLE_MESSAGE_SOURCE_JAVASCRIPT == msg_source; |
|
|
|
|
|
|
|
|
|
if (! is_from_javascript) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
gboolean is_error; |
|
|
|
|
|
|
|
|
|
msg_text = webkit_console_message_get_text(console_message); |
|
|
|
|
is_exception = |
|
|
|
|
is_error = |
|
|
|
|
NULL != strstr(msg_text, "Uncaught") || |
|
|
|
|
NULL != strstr(msg_text, "Error") || |
|
|
|
|
NULL != strstr(msg_text, "error") || |
|
|
|
|
NULL != strstr(msg_text, "Exception") || |
|
|
|
|
NULL != strstr(msg_text, "exception"); |
|
|
|
|
NULL != strstr(msg_text, "exception") || |
|
|
|
|
NULL != strstr(msg_text, "ERROR"); |
|
|
|
|
|
|
|
|
|
if (! is_exception) { |
|
|
|
|
if (! is_error) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|