browser-info 1.0.0

Cross-platform(planned) library retrieving active browser URL and detailed information
Documentation
use crate::{BrowserInfoError, BrowserType};
use active_win_pos_rs::ActiveWindow;

/// Extract URL from the active browser window
pub fn extract_url(
    window: &ActiveWindow,
    browser_type: &BrowserType,
) -> Result<String, BrowserInfoError> {
    #[cfg(target_os = "windows")]
    {
        crate::platform::windows::extract_url(window, browser_type)
    }

    #[cfg(target_os = "macos")]
    {
        crate::platform::macos::extract_url(window, browser_type)
    }

    #[cfg(target_os = "linux")]
    {
        let _ = (window, browser_type); // Suppress unused variable warnings
        // TODO: Implement Linux URL extraction
        Err(BrowserInfoError::PlatformError(
            "Linux not yet implemented".to_string(),
        ))
    }

    #[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "linux")))]
    {
        let _ = (window, browser_type); // Suppress unused variable warnings
        Err(BrowserInfoError::PlatformError(
            "Unsupported platform".to_string(),
        ))
    }
}