Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
5.11.1
-
None
-
-
a11bb985ab531fe570e6fb3d13c6e76a547b8178 (qt/qtwebengine/5.13)
Description
QWebEnginePage::runJavaScript is supposed to return the result of the latest executed statement.
However, if you do use JS Promise's or async function it always return empty QVariantMap.
Please document if such non global js code is possible with this api, and if yes, how are we expected to get the result ?
If it's not, please advice how possible is it to support such script execution in QWebEnginePage.
Our issues is to execute javascript unit tests at first where code is provided in modules.
Among other tries, here is what I tried without success which return empty QVariantMap:
(async function test() { return 42; } ())
(async function test() { return await Promise.resolve(42); } ())
async function test() { return await Promise.resolve(42); } test();