QWebEnginePage runJavaScript hangs when execution time is longer
-
Hello,
I am trying to execute JavaScript command by runJavascript function in QWebEnginePage.If the execution time is smaller it runs fine but if execution time exceed limit it hangs doesn't run even next command after that. After sometime renderProcessTerminate event fires.
webEngine.page().runJavaScript ("console.log('started'); Za(); console.log('finished');", [](const QVariant &v){qDebug() << v;});
JavaScript function Za() sometime take longer to execute when it takes longer "finished" doesn't show up. Even callback doesn't work.
Please can you help me set JavaScript unlimited execution time.
-
Hello,
I am trying to execute JavaScript command by runJavascript function in QWebEnginePage.If the execution time is smaller it runs fine but if execution time exceed limit it hangs doesn't run even next command after that. After sometime renderProcessTerminate event fires.
webEngine.page().runJavaScript ("console.log('started'); Za(); console.log('finished');", [](const QVariant &v){qDebug() << v;});
JavaScript function Za() sometime take longer to execute when it takes longer "finished" doesn't show up. Even callback doesn't work.
Please can you help me set JavaScript unlimited execution time.
@Asif-QtAddict
You're not intended to run a script which needs to take that long or blocks!Depending on what it does, what about moving it into the "document ready" event?
-
@Asif-QtAddict
You're not intended to run a script which needs to take that long or blocks!Depending on what it does, what about moving it into the "document ready" event?
@JonB youean document ready event of html?
-
@Asif-QtAddict
You're not intended to run a script which needs to take that long or blocks!Depending on what it does, what about moving it into the "document ready" event?
@JonB Thanks for the reply. I don't think it will do any good to what I wanted to do. I just need this command to run(execute) it's full time. That all I want.
-
@Asif-QtAddict
You're not intended to run a script which needs to take that long or blocks!Depending on what it does, what about moving it into the "document ready" event?
@JonB I figured it out. QWebEngineView is based on chromium 32 bit version 77.0.38 which does not support 64 bit.
I am using Qt 5.14.1 MSVS 2017.Can you guide me to 64 bit version please.
-
@JonB I figured it out. QWebEngineView is based on chromium 32 bit version 77.0.38 which does not support 64 bit.
I am using Qt 5.14.1 MSVS 2017.Can you guide me to 64 bit version please.
@Asif-QtAddict
I don't know what relevance 32- vs 64-bit has. IfQWebEngineView
uses 32-bit Chromium, than that's what it uses. -
@Asif-QtAddict
I don't know what relevance 32- vs 64-bit has. IfQWebEngineView
uses 32-bit Chromium, than that's what it uses.@JonB I have installed the Qt 5.15.2 and it has new QWebEnginePage with chromium 64 bit version: 83. So now the problem is resolved. Thanks for your help
-
@JonB I have installed the Qt 5.15.2 and it has new QWebEnginePage with chromium 64 bit version: 83. So now the problem is resolved. Thanks for your help
@Asif-QtAddict
Oh! Well I have no idea why a 64-bit Chromium should behave any differently from a 32-bit one. If all it is is that it happens to be faster, presumably the problem will re-arise when the operation takes longer. Who knows!