# browser-paths



`browser-paths` is a tiny cross‑platform helper crate that locates the executable file paths of Chrome and Edge (stable / beta / dev / canary) on the current machine.
## Installation
Add this crate by cargo
```bash
cargo add browser-paths
```
## Usage
All public helpers live in the crate root and return `Option<PathBuf>`.
```rust
use browser_paths::{
get_any_chrome_latest,
get_any_chrome_stable,
get_chrome_path,
get_any_edge_latest,
get_any_edge_stable,
get_edge_path,
};
fn main() {
// Latest available Chrome (Canary > Dev > Beta > Stable)
if let Some(path) = get_any_chrome_latest() {
println!("Latest Chrome found at: {}", path.display());
} else {
println!("No Chrome installation found.");
}
// Stable‑ish Chrome (Stable > Beta > Dev > Canary)
if let Some(path) = get_any_chrome_stable() {
println!("Stable Chrome found at: {}", path.display());
}
// Strictly the stable channel only
if let Some(path) = get_chrome_path() {
println!("Chrome stable (only) at: {}", path.display());
}
// Same helpers exist for Edge
if let Some(path) = get_any_edge_latest() {
println!("Latest Edge found at: {}", path.display());
}
if let Some(path) = get_edge_path() {
println!("Edge stable (only) at: {}", path.display());
}
}
```
## Contribution
<details>
<summary>Local development</summary>
- Clone this repository
- Install the latest version of [Rust](https://rust-lang.org/)
- Run tests using `cargo test` or `cargo run`
</details>
## Credits
`browser-paths` has been inspired by several outstanding projects in the community:
- [@edge-paths](https://github.com/shirshak55/edge-paths) - Possible paths or binary names of Edge in the current platform
- [@agent-infra/browser-finder](https://github.com/web-infra-dev/agent-browser-sdk) - find browser in your system
## License
Published under the [MIT](./LICENSE) license.
Made by [@YONGQI](https://github.com/betterhyq) 💛