Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-69904

JavaScript world IDs above 11 don't work (callback is never called)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.11.2
    • 5.9.3, 5.11.1
    • WebEngine
    • None

      When using a QWebEngineScript (with setWorldId) or QWebEnginePage::runJavaScript and passing in a world ID above 11, the callback never gets called.

      Example:

      #include <QApplication>
      #include <QWebEngineView>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QWebEngineView view;
      
          int world = 12;
          view.page()->runJavaScript("1 + 1", world, [](QVariant res){qDebug() << res; });
      
          return app.exec();
      }
      

      If the world id is changed to 11, it prints the output as expected. With world id 12, there's no output.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            allan.jensen Allan Sandfeld Jensen
            the compiler Florian Bruhin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes