#include <glib.h>
#include <curl/curl.h>
+#define WEB_CONSOLE_MSG 0
+
const char* const APPLICATION_NAME_FOR_USER_AGENT =
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.69 safari/537.36 ";
cancel_vibration();
}
+#if WEB_CONSOLE_MSG
+void __console_message_cb(void* , Evas_Object*, void* event_info)
+{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ if (!event_info) {
+ BROWSER_LOGW("[%s] even_info = nullptr", __PRETTY_FUNCTION__);
+ return;
+ }
+ Ewk_Console_Message* console_message = (Ewk_Console_Message*)event_info;
+
+ BROWSER_LOGD("<<< __console_message_cb>>");
+ BROWSER_LOGD("console message:%s:", ewk_console_message_source_get(console_message));
+ BROWSER_LOGD("console line=%d:", ewk_console_message_line_get(console_message));
+ BROWSER_LOGD("console level=%d:", ewk_console_message_level_get(console_message));
+ BROWSER_LOGD("console text%s\n", ewk_console_message_text_get(console_message));
+}
+#endif
void WebView::registerCallbacks()
{
evas_object_smart_callback_add(m_ewkView, "load,started", __loadStarted, this);
evas_object_smart_callback_add(m_ewkView, "topcontrol,moved", __top_controls_moved_cb, this);
evas_object_smart_callback_add(m_ewkView, "notification,permission,reply", __notification_reply_cb, this);
+#if WEB_CONSOLE_MSG
+ evas_object_smart_callback_add(m_ewkView, "console,message", __console_message_cb, this)
+#endif
+
ewk_view_did_change_theme_color_callback_set(m_ewkView, __theme_color_changed, this);
}
evas_object_smart_callback_del_full(m_ewkView, "topcontrol,moved", __top_controls_moved_cb, this);
evas_object_smart_callback_del_full(m_ewkView, "notification,permission,reply", __notification_reply_cb, this);
+
+#if WEB_CONSOLE_MSG
+ evas_object_smart_callback_del_full(m_ewkView, "ConsoleMessage", __console_message_cb, this);
+#endif
+
ewk_context_push_message_callback_set(m_ewkContext, nullptr, nullptr);
}