Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QWebEnginePage runJavaScript hangs when execution time is longer
Forum Updated to NodeBB v4.3 + New Features

QWebEnginePage runJavaScript hangs when execution time is longer

Scheduled Pinned Locked Moved Solved QtWebEngine
qwebenginepageqwebengineviewrunjavascript
8 Posts 2 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asif QtAddict
    wrote on last edited by
    #1

    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.

    JonBJ 1 Reply Last reply
    0
    • A Asif QtAddict

      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.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @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?

      A 3 Replies Last reply
      0
      • JonBJ JonB

        @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?

        A Offline
        A Offline
        Asif QtAddict
        wrote on last edited by
        #3

        @JonB youean document ready event of html?

        1 Reply Last reply
        0
        • JonBJ JonB

          @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?

          A Offline
          A Offline
          Asif QtAddict
          wrote on last edited by
          #4

          @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.

          1 Reply Last reply
          0
          • JonBJ JonB

            @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?

            A Offline
            A Offline
            Asif QtAddict
            wrote on last edited by
            #5

            @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.

            JonBJ 1 Reply Last reply
            0
            • A Asif QtAddict

              @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.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @Asif-QtAddict
              I don't know what relevance 32- vs 64-bit has. If QWebEngineView uses 32-bit Chromium, than that's what it uses.

              A 1 Reply Last reply
              0
              • JonBJ JonB

                @Asif-QtAddict
                I don't know what relevance 32- vs 64-bit has. If QWebEngineView uses 32-bit Chromium, than that's what it uses.

                A Offline
                A Offline
                Asif QtAddict
                wrote on last edited by
                #7

                @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

                JonBJ 1 Reply Last reply
                0
                • A Asif QtAddict

                  @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

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by
                  #8

                  @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!

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved