WebView Events
The webview will automatically emit the following events (and intentions) during its lifecycle.
To subscribe to events, you can use direct access to the event listener, using WebView::$events
property.
The webview instance also supports a more convenient and simple way of registering events using the on()
method.
Dom Ready Event
An Boson\WebView\Event\WebViewDomReady
event fired after webview DOM has been loaded and ready to work.
Favicon Changing Intention
An Boson\WebView\Event\WebViewFaviconChanging
intention to change the window's icon from loaded HTML content.
Favicon Changed Event
An Boson\WebView\Event\WebViewFaviconChanged
event fired after the window's icon has been changed and the Boson\WebView\Event\WebViewFaviconChanging
intention has not been cancelled.
Message Received Event
An Boson\WebView\Event\WebViewMessageReceived
intention to receive message from the webview.
$message
- Received message string value.
Navigating Intention
An Boson\WebView\Event\WebViewNavigating
intention to change the webview's URL (navigating to passed URL).
$url
- The URL address by which navigation occurs.$isNewWindow
- Navigation to the specified URL should have been made in a new window.$isRedirection
- Navigation to the specified URL occurs using a redirect.$isUserInitiated
- Navigation to the specified URL does not occur automatically, but is initialized by the user.
Navigated Event
An Boson\WebView\Event\WebViewNavigated
event fired after the webview has been navigated to the given URL and the Boson\WebView\Event\WebViewNavigating
intention has not been cancelled.
$url
- The URL address by which navigation occurs.
Request Intention
An Boson\WebView\Event\WebViewRequest
intention processing of user schemes registered in the configuration.
$request
- Custom protocol request instance.$response
- An optional response instance containing the body string.
Title Changing Intention
An Boson\WebView\Event\WebViewTitleChanging
intention to change the window title from loaded HTML content.
$title
- Expected title string to be set.
Title Changed Event
An Boson\WebView\Event\WebViewTitleChanged
event fired after window title has been changed and the Boson\WebView\Event\WebViewTitleChanging
intention has not been cancelled.
$title
- Title string from the HTML content of the webview.