Struct browser_window::browser::BrowserWindow
source · pub struct BrowserWindow { /* private fields */ }
Expand description
An owned browser window handle. When this handle goes out of scope, its resource get scheduled for cleanup.
Methods from Deref<Target = BrowserWindowHandle>§
sourcepub fn app(&self) -> ApplicationHandle
pub fn app(&self) -> ApplicationHandle
Returns the application handle associated with this browser window.
sourcepub async fn eval_js(&self, js: &str) -> Result<JsValue, JsEvaluationError>
pub async fn eval_js(&self, js: &str) -> Result<JsValue, JsEvaluationError>
Executes the given javascript code and returns the output as a string.
If you don’t need the result, see exec_js
.
There may be some discrepancies in what JS values are being returned for
the same code in different browser engines, or how accurate they are.
For example, Edge WebView2 doesn’t return JsValue::Undefined
, it uses
JsValue::Null
instead.
sourcepub fn exec_js(&self, js: &str)
pub fn exec_js(&self, js: &str)
Executes the given javascript code without waiting on it to finish.
Causes the browser to navigate to the given url.
pub fn url<'a>(&'a self) -> Cow<'a, str>
pub fn window(&self) -> WindowHandle
Methods from Deref<Target = WindowHandle>§
pub fn content_dimensions<'a>(&'a self) -> ContentDimensions<'_>
pub fn opacity<'a>(&'a self) -> Opacity<'_>
pub fn position<'a>(&'a self) -> Position<'_>
pub fn title<'a>(&'a self) -> Title<'_>
pub fn window_dimensions<'a>(&'a self) -> WindowDimensions<'_>
Trait Implementations§
source§impl Drop for BrowserWindow
impl Drop for BrowserWindow
source§impl HasAppHandle for BrowserWindow
impl HasAppHandle for BrowserWindow
fn app_handle(&self) -> ApplicationHandle
source§impl OwnedBrowserWindow for BrowserWindow
impl OwnedBrowserWindow for BrowserWindow
fn browser_handle(&self) -> BrowserWindowHandle
source§impl OwnedWindow for BrowserWindow
impl OwnedWindow for BrowserWindow
fn window_handle(&self) -> WindowHandle
Auto Trait Implementations§
impl RefUnwindSafe for BrowserWindow
impl !Send for BrowserWindow
impl !Sync for BrowserWindow
impl Unpin for BrowserWindow
impl UnwindSafe for BrowserWindow
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