Mercurial > dwindows
diff win/browser.c @ 2045:cb195d76de8e
Win: Make HTML_RESULT event match other platforms and disable dev tools when not DEBUG.
When javascript_run() does not have a result other platforms return a NULL pointer,
but Edge Chromium returns a string "null"; this change checks for "null" and makes it
a NULL pointer instead. This may cause problems when a "null" string result is the
expected result. Additionally disable developer tools for the HTML widget when DEBUG
is not defined when compiling.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 25 Nov 2019 04:47:43 +0000 |
parents | 89d62197124b |
children | 2bf8a22f515e |
line wrap: on
line diff
--- a/win/browser.c Mon Nov 25 03:16:45 2019 +0000 +++ b/win/browser.c Mon Nov 25 04:47:43 2019 +0000 @@ -1586,11 +1586,14 @@ if (myscript) { HRESULT hr; + void* params[2]; VariantInit(&result); hr = htmlWindow2->lpVtbl->execScript(htmlWindow2, myscript, L"javascript", &result); + params[0] = (void*)(result.vt == VT_BSTR ? WideToUTF8(result.bstrVal) : NULL); + params[1] = DW_INT_TO_POINTER((hr == S_OK ? DW_ERROR_NONE : DW_ERROR_UNKNOWN)); /* Pass the result back for event handling */ - _wndproc(hwnd, WM_USER+100, (WPARAM)(result.vt == VT_BSTR ? WideToUTF8(result.bstrVal) : NULL), (LPARAM)scriptdata); + _wndproc(hwnd, WM_USER+100, (WPARAM)params, (LPARAM)scriptdata); VariantClear(&result); SysFreeString(myscript); retval = DW_ERROR_NONE;