WebNavigationRequest
#include <bb/cascades/WebNavigationRequest>
A utility class for the bb::cascades::WebView::navigationRequested signal.
This class contains information about the requested navigation, like URL and navigation type, and it is possible to decide the response action to the request by setting the action property. You can also call WebNavigationRequest::ignore() to reject the request.
onNavigationRequested: {
console.log("NavigationRequested: " + request.url + " navigationType=" + request.navigationType)
if (shouldAcceptNavigationToUrl(request.url)) {
request.action = WebNavigationRequestAction.Accept
} else {
request.action = WebNavigationRequestAction.Ignore
}
}
BlackBerry 10.0.0
QML properties
| url | : QUrl [read-only] |
| action | : bb::cascades::WebNavigationRequestAction::Type |
| navigationType | : bb::cascades::WebNavigationType::Type [read-only] |
QML signals
| onActionChanged | : {} |
Properties Index
Public Functions Index
| WebNavigationRequest (const QUrl &url, bb::cascades::WebNavigationType::Type navigationType, QObject *parent=0) | |
| ~WebNavigationRequest () | |
| QUrl | url () const |
| bb::cascades::WebNavigationType::Type | navigationType () const |
| bb::cascades::WebNavigationRequestAction::Type | action () const |
| void | setAction (bb::cascades::WebNavigationRequestAction::Type action) |
| void | accept () |
| void | ignore () |
Signals Index
| void | actionChanged (bb::cascades::WebNavigationRequestAction::Type action) |
Properties
bb::cascades::WebNavigationRequestAction::Type
The response action to the navigation request.
This will default to WebNavigationRequestAction::Accept which means that the navigation will proceed if nothing is changed. To block the navigation request, change this to WebNavigationRequestAction::Ignore.
BlackBerry 10.0.0
Public Functions
bb::cascades::WebNavigationRequestAction::Type
The response action to the navigation request.
This will default to WebNavigationRequestAction::Accept which means that the navigation will proceed if nothing is changed. To block the navigation request, change this to WebNavigationRequestAction::Ignore.
BlackBerry 10.0.0
void
The response action to the navigation request.
This will default to WebNavigationRequestAction::Accept which means that the navigation will proceed if nothing is changed. To block the navigation request, change this to WebNavigationRequestAction::Ignore.
BlackBerry 10.0.0
void
Accept the navigation request.
Equivalent to setAction(WebNavigationRequestAction::Accept)
BlackBerry 10.0.0
void
Ignore the navigation request.
Equivalent to setAction(WebNavigationRequestAction::Ignore)
BlackBerry 10.0.0
Signals
void
Signal that the action on this request has changed.
| Parameters | |
|---|---|
| action |
The new value of the action. |
BlackBerry 10.0.0