browser-paths 1.0.2

Locate the executable file paths of Chrome and Edge based on the current platform
Documentation

browser-paths

Crates.io Version Crates.io Total Downloads Crates.io License

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

cargo add browser-paths

Usage

All public helpers live in the crate root and return Option<PathBuf>.

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

  • Clone this repository
  • Install the latest version of Rust
  • Run tests using cargo test or cargo run

Credits

browser-paths has been inspired by several outstanding projects in the community:

License

Published under the MIT license. Made by @YONGQI 💛