[Interest] Detecting container app on web page

Kai Koehne Kai.Koehne at qt.io
Wed Nov 2 09:19:11 CET 2016



> -----Original Message-----
> From: Interest [mailto:interest-bounces+kai.koehne=qt.io at qt-project.org]
> On Behalf Of Jani Tykka
> Sent: Wednesday, November 02, 2016 7:09 AM
> To: interest at qt-project.org Interest <interest at qt-project.org>
> Subject: [Interest] Detecting container app on web page
> 
> Hi,
> 
> I load web page to QML WebEngineView. Is there any method in Javascript
> that can be used to detect on webpage that the container app is Qt
> application?
>
>Of course I could use special HTTP user-agent header or give the information
> in URL params when requesting the web page, but I'm curious if this can be
> done in Javascript.

You could indeed check the user agent, e.g.

 navigator.userAgent.includes('QtWebEngine')

Anyhow, may I ask why you need to know this? Ideally you'd check for the API/functionality
you're after, not the browser.

Regards

Kai



More information about the Interest mailing list