[Interest] QWebEnginePage acceptNavigationRequest leads to empty page
sven.bergner at gmail.com
Tue Jan 29 12:01:00 CET 2019
thanks for your suggestion. I think I've found the root of the behavior.
The link has a target="_blank" and that calls createWindow() which leads to
an empty window.
If I remove the target="_blank" I can intercept the link.
But for me that feels also like an error. What sense does it make to create
a new window when I don't need it because acceptNavigationRequest() returns
Am Mo., 28. Jan. 2019 um 23:25 Uhr schrieb Allan Sandfeld Jensen <
kde at carewolf.com>:
> On Montag, 28. Januar 2019 13:11:45 CET Sven Bergner wrote:
> > Hi there,
> > I have an app that uses QWebEngine to show a webpage that has a link to a
> > pdf document.
> > Now I want to handle a click on that link by
> > implementing QWebEnginePage::acceptNavigationRequest().
> > The method is called an I can check if the link leads to a pdf and if so
> > handle the url by myself and return false. The downside is that the
> > QWebEngineView now shows an empty page.
> > Is there any way to prevent this? I want to stay on the same page where
> > link was clicked.
> > Any hints?
> Try disabling error-pages, with error-pages disabled, errors should result
> staying on the same page, where with them enabled, navigations always go
> Still sounds like an error, navigation should either not be performed or
> go an
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest