# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1573092469 0 # Node ID 617a78dc70aae4328dc3ddf56e8db5bb5150115a # Parent 8577d533b371e5ae59789d2edd53d9a29e4e4bfd Added a number of possible javascript snippets to test. Pass NULL in the result field of the html result callback in the case of a non-string javascript result, instead of a generic error message. diff -r 8577d533b371 -r 617a78dc70aa dwtest.c --- a/dwtest.c Thu Nov 07 01:39:52 2019 +0000 +++ b/dwtest.c Thu Nov 07 02:07:49 2019 +0000 @@ -1738,7 +1738,8 @@ /* Handle web javascript result */ int DWSIGNAL web_html_result(HWND html, int status, char *result, void *user_data, void *script_data) { - dw_messagebox("Javascript Result", DW_MB_OK | (status ? DW_MB_ERROR : DW_MB_INFORMATION), result); + dw_messagebox("Javascript Result", DW_MB_OK | (status ? DW_MB_ERROR : DW_MB_INFORMATION), + result ? result : "Javascript result is not a string value"); return TRUE; } @@ -1845,7 +1846,10 @@ HWND htmlstatus; HWND hbox = dw_box_new(DW_HORZ, 0); HWND item; - HWND javascript = dw_entryfield_new("window.scrollTo(0,500);", 0); + HWND javascript = dw_combobox_new("", 0); + + dw_listbox_append(javascript, "window.scrollTo(0,500);"); + dw_listbox_append(javascript, "window.document.title;"); dw_box_pack_start( notebookbox7, rawhtml, 0, 100, TRUE, FALSE, 0); dw_html_raw(rawhtml, "

dwtest

"); diff -r 8577d533b371 -r 617a78dc70aa gtk3/dw.c --- a/gtk3/dw.c Thu Nov 07 01:39:52 2019 +0000 +++ b/gtk3/dw.c Thu Nov 07 02:07:49 2019 +0000 @@ -1247,7 +1247,7 @@ g_free (str_value); } else if(htmlresultfunc) - htmlresultfunc((HWND)object, DW_ERROR_UNKNOWN, "Unknown javascript error", user_data, script_data); + htmlresultfunc((HWND)object, DW_ERROR_UNKNOWN, NULL, user_data, script_data); webkit_javascript_result_unref (js_result); #endif }