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. acceptNavigationRequest only called for explicitly clicked links

acceptNavigationRequest only called for explicitly clicked links

Scheduled Pinned Locked Moved Solved QtWebEngine
1 Posts 1 Posters 717 Views 1 Watching
  • 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.
  • Rainer SprengelR Offline
    Rainer SprengelR Offline
    Rainer Sprengel
    wrote on last edited by Rainer Sprengel
    #1

    I have an application, which shows html-mails in a QWebEngineView. I want to filter requests for external images (or other http-requests). Therefore I have a subclass of QWebEnginePage and implemented the acceptNavigationRequest-method. I set an instance of this subclass via setPage in my QWebEngineView. Then I call setHtml with the mail-body and a local BaseUrl.
    But the html-page the acceptNavigationRequest-method isn't called when the html-page is loaded. So all images are shown although the links are absolute (eample: <img src="http://xxx.com/images/yyy.jpg">).

    The acceptNavigationRequest-method is only called if I click on a html-link (example <a href="https://xxx.com/zzz">). Is there any possibility, that the method will also be called for external images? Or is there another method to control the requests for images on external server?

    I found the solution to my problem. It is possible to supress the automatic loading of images with the QWebEngineSettings::AutoLoadImages attribute.

    1 Reply Last reply
    0

    • Login

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