pub struct WebviewWrapper { /* private fields */ }
Methods from Deref<Target = WebView>§
Sourcepub fn evaluate_script_with_callback(
&self,
js: &str,
callback: impl Fn(String) + Send + 'static,
) -> Result<(), Error>
pub fn evaluate_script_with_callback( &self, js: &str, callback: impl Fn(String) + Send + 'static, ) -> Result<(), Error>
Evaluate and run javascript code with callback function. The evaluation result will be serialized into a JSON string and passed to the callback function.
Exception is ignored because of the limitation on windows. You can catch it yourself and return as string as a workaround.
- ** Android:** Not implemented yet.
Get a list of cookies for specific url.
Sourcepub fn open_devtools(&self)
pub fn open_devtools(&self)
Open the web inspector which is usually called dev tool.
§Platform-specific
- Android / iOS: Not supported.
Sourcepub fn close_devtools(&self)
pub fn close_devtools(&self)
Close the web inspector which is usually called dev tool.
§Platform-specific
- Windows / Android / iOS: Not supported.
Sourcepub fn is_devtools_open(&self) -> bool
pub fn is_devtools_open(&self) -> bool
Gets the devtool window’s current visibility state.
§Platform-specific
- Windows / Android / iOS: Not supported.
Sourcepub fn zoom(&self, scale_factor: f64) -> Result<(), Error>
pub fn zoom(&self, scale_factor: f64) -> Result<(), Error>
Set the webview zoom level
§Platform-specific:
- Android: Not supported.
- macOS: available on macOS 11+ only.
- iOS: available on iOS 14+ only.
Sourcepub fn set_background_color(
&self,
background_color: (u8, u8, u8, u8),
) -> Result<(), Error>
pub fn set_background_color( &self, background_color: (u8, u8, u8, u8), ) -> Result<(), Error>
Specify the webview background color.
The color uses the RGBA format.
§Platfrom-specific:
- macOS / iOS: Not implemented.
- Windows:
- On Windows 7, transparency is not supported and the alpha value will be ignored.
- On Windows higher than 7: translucent colors are not supported so any alpha value other than
0
will be replaced by255
Sourcepub fn load_url_with_headers(
&self,
url: &str,
headers: HeaderMap,
) -> Result<(), Error>
pub fn load_url_with_headers( &self, url: &str, headers: HeaderMap, ) -> Result<(), Error>
Navigate to the specified url using the specified headers
Sourcepub fn clear_all_browsing_data(&self) -> Result<(), Error>
pub fn clear_all_browsing_data(&self) -> Result<(), Error>
Clear all browsing data
pub fn bounds(&self) -> Result<Rect, Error>
Sourcepub fn set_bounds(&self, bounds: Rect) -> Result<(), Error>
pub fn set_bounds(&self, bounds: Rect) -> Result<(), Error>
Set the webview bounds.
This is only effective if the webview was created as a child
or created using [WebViewBuilderExtUnix::new_gtk
] with gtk::Fixed
.
Trait Implementations§
Source§impl Clone for WebviewWrapper
impl Clone for WebviewWrapper
Source§fn clone(&self) -> WebviewWrapper
fn clone(&self) -> WebviewWrapper
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more