Decode strings returned by ExecuteScript()

ExecuteScript returns strings as fully
quoted JSON strings so they have to be decoded
to a binary string.
This commit is contained in:
Tobias Taschner
2020-01-17 21:11:26 +01:00
parent fb0e82e9d1
commit 26c82d43d1
2 changed files with 91 additions and 1 deletions

View File

@@ -24,6 +24,7 @@
#include "wx/stdpaths.h"
#include "wx/thread.h"
#include "wx/private/jsscriptwrapper.h"
#include "wx/private/json.h"
#include "wx/msw/private.h"
#include "wx/msw/private/webview_edge.h"
@@ -810,7 +811,7 @@ bool wxWebViewEdge::RunScript(const wxString& javascript, wxString* output)
if (RunScriptSync(wrapJS.GetUnwrappedOutputCode() + ";", &result))
{
if (output)
*output = result;
*output = wxJSON::DecodeString(result);
result.clear();
}