Skip to content

Conversation

@anshukaushik4700
Copy link
Contributor

This PR improves the get_firefox_profiles() function by adding support for parsing Firefox’s profiles.ini file to display readable profile names instead of raw folder names.

Key Updates

  • Implemented parsing of profiles.ini using the ini crate.
  • Extracted the Name, Path, and IsRelative fields from each [ProfileX] section.
  • Resolved relative vs absolute paths correctly for all platforms (Windows, macOS, Linux).
  • Added fallback logic to list profile directories when profiles.ini is not found.
  • Sorted profiles alphabetically by display name for consistent UI rendering.

Benefits

  • - Users now see friendly names like "Work" or "Personal" instead of hashed folders.
  • - Maintains compatibility with existing fallback behavior when no profiles.ini is available.

Fixes: #49

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

@anshukaushik4700
Copy link
Contributor Author

@theg1239 sir i opened this PR to solve issue #49 please let me know if this needs any improvements. Thanks for your time and review.

@theg1239
Copy link
Member

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 175 to +177
pub fn get_firefox_profiles() -> Result<Vec<ProfileDescriptor>, Box<dyn std::error::Error>> {
use std::path::PathBuf;
use ini::Ini;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Import uses undeclared crate

The Firefox profile parsing code imports ini::Ini, but the new dependency was added under the name rust-ini in Cargo.toml. Because Cargo exposes the crate as rust_ini by default, the module ini does not exist and the project fails to compile. Rename the dependency to ini (or alias it) or change the import to rust_ini::Ini so the code builds.

Useful? React with 👍 / 👎.

@anshukaushik4700
Copy link
Contributor Author

Hey! I’ve made the changes to fix the rust-ini import issue.
The project now builds successfully. Let me know if any further changes are needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parse Firefox profiles.ini for friendlier profile names

2 participants