[][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 preferably on the main thread. To do this we use Application::start(), which gives you an application handle that can be used to create the browser windows.

Your program might look something like this:

use browser_window::*;

fn main() {
	let app = Application::start();

	BrowserWindowBuilder::new( Source::Url("https://www.duckduckgo.com/".to_owned()) )
	.spawn( &app, |browser| {
		browser.exec_js(" ... ");
	});
}

For an example that uses Browser Window in an asynchronous context, see this example code.

Structs

Application

A thread-unsafe handle to an application instance. Use this to start the application with.

ApplicationAsync

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

ApplicationHandle

An handle for this application. Can be seen as an interface for the Application and ApplicationAsync 'handles'.

BrowserWindow

A thread-unsafe handle to a browser window.

BrowserWindowAsync

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

BrowserWindowBuilder

Used to create a BrowserWindow instance.

BrowserWindowHandle

A handle to a browser window. This can not be instantiated, but can be seen as an interface that is provided for by the BrowserWindow and BrowserWindowAsync 'handles'.

Enums

Source

The type of content to display in a browser window

Type Definitions

ApplicationDispatchFuture

The future that dispatches a closure onto the GUI thread

BrowserWindowDispatchFuture

The future that dispatches a closure on the GUI thread used by BrowserWindowAsync.