[][src]Crate browser_window

Browser Window is a Rust crate that allows you to have and manipulate windows with browsers in them. Just like Electron, you can build graphical user interfaces with HTML/CSS/JS technology, but you can also use it to just have some browser functionality in your application.

To start using Browser Window, you need to start it (before anything else) and run it, preferably on the main thread.

Your program might look something like this:

use browser_window::*;
use std::process::exit;

fn main() {
	let runtime = Runtime::start();

	let app = runtime.app();
	let exit_code = runtime.spawn(async move {

		let browser = BrowserWindowBuilder::new( Source::Url("https://www.duckduckgo.com/".into()) )
			.build( app ).await;

		browser.exec_js("document.getElementById('search_form_input_homepage').value = 'Hello World!'").await;
	});

	exit( exit_code );
}

For an more elaborate example, see this example code.

Structs

Application

An handle for this application.

ApplicationThreaded

A thread-safe application handle. This handle also allows you to dispatch code to be executed on the GUI thread.

Browser

A thread-unsafe handle to a browser window

BrowserBuilder

Used to create a Browser or BrowserThreaded instance.

BrowserThreaded

A thread-safe handle to a browser window. It allows you to dispatch code to the GUI thread.

Runtime

Use this to start and run the application with.

Enums

Source

The type of content to display in a browser window

Type Definitions

ApplicationDelegateFuture

The future that dispatches a closure onto the GUI thread

BrowserDelegateFuture

The future that dispatches a closure on the GUI thread.