diff options
author | cookie <cookie@samsung.com> | 2017-07-05 10:05:15 +0000 |
---|---|---|
committer | cookie <cookie@samsung.com> | 2017-07-06 08:50:25 +0000 |
commit | ccbe4b3e3a4e47fe16c810bfb1107d8ed3e47322 (patch) | |
tree | 9fc8611f556043944095ec3dde0299fa6b54c7fe | |
parent | cebc1d1a8b7435fbed8afa2e57cd6c28660cd51c (diff) | |
download | browser-ccbe4b3e3a4e47fe16c810bfb1107d8ed3e47322.tar.gz browser-ccbe4b3e3a4e47fe16c810bfb1107d8ed3e47322.tar.bz2 browser-ccbe4b3e3a4e47fe16c810bfb1107d8ed3e47322.zip |
Add the Web Contents Console Meesage
[ Problem ] http://suprem.sec.samsung.net/jira/browse/RWASP-1859
[ Cause ] There is no implementation
[ Solution]Implementation console msg
[ Verify ] Check it by sdb dlog
Change-Id: I8ec4548b7032443c57b1d90ce08060854adac2eb
Signed-off-by: cookie <cookie@samsung.com>
-rwxr-xr-x | services/WebEngineService/WebView.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/services/WebEngineService/WebView.cpp b/services/WebEngineService/WebView.cpp index ccb47f4..76c1498 100755 --- a/services/WebEngineService/WebView.cpp +++ b/services/WebEngineService/WebView.cpp @@ -59,6 +59,8 @@ #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 "; @@ -246,6 +248,23 @@ void __vibration_cancel_cb(void * /*data*/) 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); @@ -288,6 +307,10 @@ void WebView::registerCallbacks() 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); } @@ -331,6 +354,11 @@ void WebView::unregisterCallbacks() 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); } |