Struct BrowserWindow

Source
pub struct BrowserWindow(/* private fields */);

Implementations§

Source§

impl BrowserWindow

Source

pub fn on_address_changed(&self) -> AddressChangedEvent

Whenver the address URI changes

Source

pub fn on_console_message(&self) -> ConsoleMessageEvent

When a console message is printend.

Source

pub fn on_fullscreen_mode_changed(&self) -> FullscreenModeChangedEvent

Whenever the browser goes into or out of full screen mode.

Source

pub fn on_loading_progress_changed(&self) -> LoadingProgressChangedEvent

Loading progress updates

Source

pub fn on_message(&self) -> MessageEvent

The event that will fire whenever invoke_extern is called with JS on the client side. This event is implemented for all browser frameworks.

Source

pub fn on_navigation_end(&self) -> NavigationEndEvent

Whenever navigation has finished and the page has loaded.

Source

pub fn on_navigation_start(&self) -> NavigationStartEvent

Whenever navigation to a new link happens.

Source

pub fn on_page_title_changed(&self) -> PageTitleChangedEvent

Whenver the page title changes.

Source

pub fn on_status_message(&self) -> StatusMessageEvent

Source

pub fn on_tooltip(&self) -> TooltipEvent

Whenever the browser is about to show a tooltip

Source

pub fn on_auth_credentials(&self) -> AuthCredentialsEvent

Not implemented yet.

Source

pub fn on_certificate_error(&self) -> CertificateErrorEvent

Not implemented yet.

Source

pub fn on_download_progress(&self) -> DownloadProgressEvent

Not implemented yet.

Source

pub fn on_download_started(&self) -> DownloadStartedEvent

Not implemented yet.

Source

pub fn on_favicon_changed(&self) -> FaviconChangedEvent

Not implemented yet.

Source

pub fn on_file_dialog(&self) -> FileDialogEvent

Not implemented yet.

Source

pub fn on_key_press(&self) -> KeyPressEvent

Not implemented yet.

Source

pub fn on_key_pressed(&self) -> KeyPressedEvent

Not implemented yet.

Source

pub fn on_scroll_offset_changed(&self) -> ScrollOffsetChangedEvent

Not implemented yet.

Source

pub fn on_select_client_certificate(&self) -> SelectClientCertificateEvent

Not implemented yet.

Source

pub fn on_start_dragging(&self) -> StartDraggingEvent

Not implemented yet.

Source

pub fn on_text_selection_changed(&self) -> TextSelectionChangedEvent

Not implemented yet.

Methods from Deref<Target = BrowserWindowHandle>§

Source

pub fn app(&self) -> ApplicationHandle

Returns the application handle associated with this browser window.

Source

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.

Source

pub fn exec_js(&self, js: &str)

Executes the given javascript code without waiting on it to finish.

Source

pub fn navigate(&self, url: &str)

Causes the browser to navigate to the given url.

Source

pub fn url<'a>(&'a self) -> Cow<'a, str>

Source

pub fn window(&self) -> &WindowHandle

Methods from Deref<Target = WindowHandle>§

Source

pub fn content_dimensions(&self) -> Dims2D

Source

pub fn opacity(&self) -> u8

Source

pub fn position(&self) -> Pos2D

Source

pub fn title(&self) -> String

Source

pub fn window_dimensions(&self) -> Dims2D

Source

pub fn hide(&self)

Hides the window. Keep in mind that hiding the window is not the same as closing it. Hiding the window will keep it’s resources alive. If the window is hidden, and all window handles are gone, the memory is effectively leaked.

Source

pub fn set_content_dimensions(&self, dimensions: Dims2D)

Source

pub fn set_opacity(&self, opacity: u8)

Source

pub fn set_position(&self, position: Pos2D)

Source

pub fn set_title(&self, title: &str)

Source

pub fn set_window_dimensions(&self, dimensions: Dims2D)

Source

pub fn show(&self)

Shows a window if it was hidden. Windows that were just created are hidden to start. This method is necessary to show it to the user.

Trait Implementations§

Source§

impl Clone for BrowserWindow

Source§

fn clone(&self) -> BrowserWindow

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl HasHandle<ApplicationHandle> for BrowserWindow

Source§

impl HasHandle<WindowHandle> for BrowserWindow

Source§

impl Deref for BrowserWindow

Source§

type Target = BrowserWindowHandle

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<H> HasHandle<H> for H

Source§

fn handle(&self) -> &H

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V