1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
//! 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](https://github.com/bamilab/browser-window/blob/master/example/src/main.rs). mod application; mod browser; mod common; //mod treelink; pub use application::{ Application, ApplicationThreaded, ApplicationDelegateFuture, Runtime }; pub use browser::{ Browser, BrowserThreaded, BrowserDelegateFuture }; pub use browser::builder::{ BrowserBuilder, Source };