pub trait WebViewHandler: Send + Sync {
// Provided methods
fn on_cursor_change(&self, ty: CursorType) { ... }
fn on_state_change(&self, state: WebViewState) { ... }
fn on_title_change(&self, title: &str) { ... }
fn on_fullscreen_change(&self, fullscreen: bool) { ... }
fn on_message(&self, message: &str) { ... }
}Expand description
WebView handler
This trait is used to handle web view events.
Provided Methods§
Sourcefn on_cursor_change(&self, ty: CursorType)
fn on_cursor_change(&self, ty: CursorType)
Called when the cursor changes
When the web page wants to change the mouse pointer style, it will be triggered, such as moving to a link.
Sourcefn on_state_change(&self, state: WebViewState)
fn on_state_change(&self, state: WebViewState)
Called when the web page state changes
You need to pay attention to status changes, determine whether loading was successful, and monitor events related to the page closing.
Sourcefn on_title_change(&self, title: &str)
fn on_title_change(&self, title: &str)
Called when the title changes
Sourcefn on_fullscreen_change(&self, fullscreen: bool)
fn on_fullscreen_change(&self, fullscreen: bool)
Called when the fullscreen state changes
Sourcefn on_message(&self, message: &str)
fn on_message(&self, message: &str)
Called when a message is received
This callback is called when a message is received from the web page.