DB Navigator app - help needed (with webkit detection?)
-
Hi all, I forked an app from the store to create another (https://open-store.io/app/dbnav.klmhsb42) to navigate through the https://bahn.de website and here is my repo https://gitlab.com/klmhsb42/dbnav-ub-touch/-/tree/main/dbnav
If I open https://mobile.bahn.de/bin/mobil/query.exe/dox?country=DEU&rt=1&use_realtime_filter=1&webview=&searchMode=NORMAL with the app different .css files are provided from the webserver than if I open it with the morph browser (see screenshots).
In the the css file view-source:https://www.img-bahn.de/s3/prod/v/cms/mobile/css/touch.css they say that it's only for webkit browser but the morph browser uses Qt WebEngine as I do in the app. So I don't know where the problem is. I'm new to qml btw. I would be happy about any help...
-
-
I did another test with the duckduckgo web app (same qml code) https://gitlab.com/klmhsb42/duckduckgo-ub-touch/-/tree/master/duckduckgo and visited https://www.whatismybrowser.com/ which tells me that it's a qtwebengine and not the one set in the UserAgent https://gitlab.com/klmhsb42/duckduckgo-ub-touch/-/blob/master/duckduckgo/qml/Main.qml
I've seen in some forums that I need to set setHttpUserAgent https://doc.qt.io/qt-5/qwebengineprofile.html#setHttpUserAgent but I didn't have any success yet to get it working. Does anyone know how to set this correctly?
-
ok, I found a bug, I have to write
profile: WebEngineProfile
where the "profile:" was missing. Now the user agent is detected, but still it loads the non-touch friendly website version...