Nominate our 2022 Qt Champions!

Detect custom URL scheme

  • Is there any way to detect when a QWebView tries to load a custom URL scheme? For example, if the web view loads a page that has the following [removed]

    @[removed].href = "myapp://actionurl?action=login";@

    Is there any way to receive a signal when this code is run?

  • First removed should say "javascript". Second should say "window".

  • Maybe the signal QWebPage::unsupportedContent ( QNetworkReply * reply ) ?

    Otherwise you could overload bool QWebPageacceptNavigationRequest ( QWebFrame * frame, const QNetworkRequest & request, NavigationType type ) and check the URL before the request is sent.

    Depends what you want to do and what myapp:// exactly is.

Log in to reply