}
static void
+_console_message_hook(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *message, unsigned int line_number, const char *source_id)
+{
+ printf("CONSOLE: %s:%d:%s\n", source_id, line_number, message);
+}
+
+static void
_js_popup_hooks_set(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Web_Test *wt = data;
elm_web_dialog_prompt_hook_set(wt->web, _prompt_hook, NULL);
elm_web_dialog_file_selector_hook_set(wt->web, _file_selector_hook,
NULL);
+ elm_web_console_message_hook_set(wt->web, _console_message_hook, NULL);
}
else
{
elm_web_dialog_confirm_hook_set(wt->web, NULL, NULL);
elm_web_dialog_prompt_hook_set(wt->web, NULL, NULL);
elm_web_dialog_file_selector_hook_set(wt->web, NULL, NULL);
+ elm_web_console_message_hook_set(wt->web, NULL, NULL);
}
}
return response;
}
+static void
+_view_smart_add_console_message(Ewk_View_Smart_Data *esd, const char *message, unsigned int line_number, const char *source_id)
+{
+ Evas_Object *obj = evas_object_smart_parent_get(esd->self);
+ Widget_Data *wd = elm_widget_data_get(obj);
+
+ if (wd->hook.console_message)
+ wd->hook.console_message(wd->hook.console_message_data, obj, message,
+ line_number, source_id);
+}
+
static Eina_Bool
_view_smart_focus_can_cycle(Ewk_View_Smart_Data *sd, Ewk_Focus_Direction direction)
{
api.mouse_down = _view_smart_mouse_down;
api.mouse_up = _view_smart_mouse_up;
api.mouse_move = _view_smart_mouse_move;
- //api.add_console_message = _view_smart_add_console_message;
+ api.add_console_message = _view_smart_add_console_message;
api.window_create = _view_smart_window_create;
api.window_close = _view_smart_window_close;
api.run_javascript_alert = _view_smart_run_javascript_alert;