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
Forum Updated to NodeBB v4.3 + New Features

acceptNavigationRequest only called for explicitly clicked links

Scheduled Pinned Locked Moved Solved QtWebEngine
1 Posts 1 Posters 662 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.
  • R Offline
    R Offline
    Rainer Sprengel
    wrote on 3 Apr 2016, 00:49 last edited by Rainer Sprengel 4 Mar 2016, 21:04
    #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

    1/1

    3 Apr 2016, 00:49

    • Login

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