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. QT5.15.11 issue with XMLHttpRequest
Forum Updated to NodeBB v4.3 + New Features

QT5.15.11 issue with XMLHttpRequest

Scheduled Pinned Locked Moved Unsolved QtWebEngine
2 Posts 1 Posters 176 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.
  • V Offline
    V Offline
    Vibhu
    wrote on 1 Feb 2025, 06:08 last edited by
    #1

    Hi,

    We have recently updated from QT5.9.7 to QT5.15.11 in Linux environment for embedded device.
    Linux 4.4.188-cip36
    x86_64 GNU/Linux

    The application layer which uses Javascript and Ajax call have started throwing below error.
    The same was working fine with QT5.9.7.
    We have tried changing XMLHttpRequest Sync calls to Async, but then the application starts throwing different error related to timeout on page load.

    Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
    Uncaught (in promise) NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load

    We tried below in our QT application code, but nothing worked. Any suggestions to configure QT5.15.11 to support 5.9.7 compatible code ?

    "QWebEngineProfile::defaultProfile()->setHttpCacheType(QWebEngineProfile::MemoryHttpCache);
    QWebEngineProfile::defaultProfile()->setPersistentCookiesPolicy(QWebEngineProfile::AllowPersistentCookies);"

    "QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
    QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, true);
    QWebEngineProfile::defaultProfile()->setHttpCacheType(QWebEngineProfile::MemoryHttpCache);
    QWebEngineProfile::defaultProfile()->setPersistentCookiesPolicy(QWebEngineProfile::AllowPersistentCookies);"

    qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-web-security --allow-running-insecure-content");

    export QT_QUICK_COMPATIBILITY_VERSION=5.9 in setenv

    Thanks

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Vibhu
      wrote on 4 Feb 2025, 04:23 last edited by
      #2

      If I comment below lines in component which is handling Webengine and browser related logic, the issue is not observed.

      QWebEngineProfile *m_profile;
      m_profile- >clearHttpCache();

      Any idea if we need to change above to logic in QT5.15.11 for better handling. As currently it seems call is hang/stuck if i keep it.

      1 Reply Last reply
      0

      1/2

      1 Feb 2025, 06:08

      • Login

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