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>
Trait Implementations§
Source§impl Clone for WebviewWrapper
impl Clone for WebviewWrapper
Source§fn clone(&self) -> WebviewWrapper
fn clone(&self) -> WebviewWrapper
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Deref for WebviewWrapper
impl Deref for WebviewWrapper
Auto Trait Implementations§
impl Freeze for WebviewWrapper
impl !RefUnwindSafe for WebviewWrapper
impl !Send for WebviewWrapper
impl !Sync for WebviewWrapper
impl Unpin for WebviewWrapper
impl !UnwindSafe for WebviewWrapper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)