#browser #webbrowser

webbrowser

Open URLs in web browsers available on a platform

6 releases

0.3.1 Jun 22, 2018
0.3.0 Jun 16, 2018
0.2.2 Jan 23, 2017
0.1.3 Jan 11, 2016
0.1.2 Dec 8, 2015

#15 in Rendering

Download history 181/week @ 2018-08-07 205/week @ 2018-08-14 173/week @ 2018-08-21 196/week @ 2018-08-28 204/week @ 2018-09-04 361/week @ 2018-09-11 764/week @ 2018-09-18 608/week @ 2018-09-25 465/week @ 2018-10-02 283/week @ 2018-10-09 436/week @ 2018-10-16 428/week @ 2018-10-23 437/week @ 2018-10-30

1,500 downloads per month
Used in 6 crates

MIT/Apache

11KB
152 lines

webbrowser

Rust library to open URLs in the web browsers available on a platform

Inspired by the webbrowser python library

Detailed documentation

Crate location

Examples

use webbrowser;

if webbrowser::open("http://github.com").is_ok() {
    // ...
}

Currently state of platform support is:

  • macos => default, as well as browsers listed under Browser
  • windows => default browser only
  • linux => default browser only (uses $BROWSER env var, failing back to xdg-open, gvfs-open, gnome-open, whichever works first)
  • android => not supported right now
  • ios => not supported right now

Important note:

  • This library requires availability of browsers and a graphical environment during runtime
  • cargo test will actually open the browser locally

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps