QT5.15.11 issue with XMLHttpRequest
-
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/LinuxThe 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 loadWe 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
-
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.