pub struct WebView { /* private fields */ }
Expand description

The fundamental type to present a WebView.

WebViewBuilder / WebView are the basic building blocks to constrcut WebView contents and scripts for those who prefer to control fine grained window creation and event handling. WebView presents the actuall WebView window and let you still able to perform actions during event handling to it. WebView also contains the associate Window with it.

Implementations

Create a WebView from provided Window. Note that calling this directly loses abilities to initialize scripts, add ipc handler, and many more before starting WebView. To benefit from above features, create a WebViewBuilder instead.

Platform-specific behavior:

  • Unix: This method must be called in a gtk thread. Usually this means it should be called in the same thread with the EventLoop you create.

Get the Window associate with the WebView. This can let you perform window related actions.

Evaluate and run javascript code. Must be called on the same thread who created the WebView. Use EventLoopProxy and a custom event to send scripts from other threads.

Launch print modal for the webview content.

Resize the WebView manually. This is only required on Windows because its WebView API doesn’t provide a way to resize automatically.

Moves Focus to the Webview control.

It’s usually safe to call focus method on Window which would also focus to WebView except Windows. Focussing to Window doesn’t mean focussing to WebView on Windows. For example, if you have an input field on webview and lost focus, you will have to explicitly click the field even you re-focus the window. And if you focus to WebView, it will lost focus to the Window.

Open the web insepctor which is usually called dev tool.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.