Details
Description
When doing Ctrl+click on a link or using javascript window.open, createWindow() is called, followed by acceptNavigationRequest() on the new page. In a web browser (konqueror) we need to be able to differenciate between the two use cases, e.g. to implement things like a confirmation messagebox ("this website wants to open a popup, accept/deny?").
With QtWebkit we used the NavigationType enum passed to acceptNavigationRequest(), if it was NavigationTypeLinkClicked it was a user action (no confirmation), if it was NavigationTypeOther it was triggered by javascript.
With QtWebEngine the API looks the same, but the type enum is always NavigationTypeLinkClicked, it seems.
Testcase:
<a href="javascript:setTimeout(window.open('http://www.davidfaure.fr'), 3000)">window.open delayed</a>
QtWebKit says:
NewWindowPage::acceptNavigationRequest: url: QUrl("http://www.davidfaure.fr/") ,type: 5 (NavigationTypeOther)
QtWebEngine says:
NewWindowPage::acceptNavigationRequest: url: QUrl("http://www.davidfaure.fr/") , type: 0 (NavigationTypeLinkClicked)
Attachments
Issue Links
- duplicates
-
QTBUG-74490 Wrong NavigationType for http-equiv=REFRESH
- Closed
- is duplicated by
-
QTBUG-50672 QWebEnginePage::acceptNavigationRequest() is called with type NavigationTypeLinkClicked even when no links have been clicked
- Closed
-
QTBUG-63265 When reimplement acceptNavigationRequest a url with NavigationTypeLinkClicked is passed in after a page has finished loading
- Closed
-
QTBUG-52239 QWebEngineUrlRequestInterceptor::interceptRequest invalid type returned by QWebEngineUrlRequestInfo::navigationType()
- Closed