Fix javascript return values

Return values where wrapped by quotes because of
wrapper code used for IE compatibility.
This commit is contained in:
Tobias Taschner
2020-01-16 20:49:00 +01:00
parent 20c155e67f
commit 048c1c4321
2 changed files with 3 additions and 1 deletions

View File

@@ -150,6 +150,8 @@ public:
#endif
}
const wxString& GetUnwrappedOutputCode() { return m_outputVarName; }
// Execute the code returned by this function to let the output of the code
// we executed be garbage-collected.
wxString GetCleanUpCode() const

View File

@@ -795,7 +795,7 @@ bool wxWebViewEdge::RunScript(const wxString& javascript, wxString* output)
if (RunScriptSync(wrapJS.GetWrappedCode(), &result)
&& result == wxS("true"))
{
if (RunScriptSync(wrapJS.GetOutputCode(), &result))
if (RunScriptSync(wrapJS.GetUnwrappedOutputCode() + ";", &result))
{
if (output)
*output = result;