Skip to content

Explain how Firefox uses user profiles #2262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Ozoniuss
Copy link
Contributor

@Ozoniuss Ozoniuss commented Apr 5, 2025

User description

Description

This extends the Firefox profile documentation by explaining how Selenium works when supplying an existing profile directory. Since profiles are not cleaned up by Selenium, it also describes how they can be explicitly removed by the user.

Note that I think that rather than telling the user to look up the code on how to find the exposed profile path, it may be more appropriate to provide code samples on how to delete it (in addition to code samples on how to use an existing profile, which I didn't find). I may do a PR for that (including moving from the inline code samples), but since I have to test it in several langauges including some I never worked it, it would take a while.

Motivation and Context

While developing and debugging my application, I ran out of space on my system because I was using a large profile, and it took a while to figure out where exactly the problem was.

Types of changes

  • Change to the site (I have double-checked the Netlify deployment, and my changes look good)
  • Code example added (and I also added the example to all translated languages)
  • Improved translation
  • Added new translation (and I also added a notice to each document missing translation)

Checklist

  • I have read the contributing document.
  • I have used hugo to render the site/docs locally and I am sure it works.

PR Type

Documentation


Description

  • Added explanation on using existing Firefox profiles in Selenium.

  • Highlighted that Selenium does not clean up profile copies.

  • Provided instructions for explicitly removing profile copies.

  • Linked to official Firefox documentation for profile directory guidance.


Changes walkthrough 📝

Relevant files
Documentation
firefox.en.md
Added Firefox profile usage and cleanup details (English)

website_and_docs/content/documentation/webdriver/browsers/firefox.en.md

  • Added note on using existing Firefox profiles.
  • Explained Selenium's handling of profile copies.
  • Included guidance for explicit profile cleanup.
  • Linked to Firefox documentation for profile directory details.
  • +8/-0     
    firefox.zh-cn.md
    Added Firefox profile usage and cleanup details (Chinese)

    website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md

  • Added note on using existing Firefox profiles.
  • Explained Selenium's handling of profile copies.
  • Included guidance for explicit profile cleanup.
  • Linked to Firefox documentation for profile directory details.
  • +9/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Copy link

    netlify bot commented Apr 5, 2025

    👷 Deploy request for selenium-dev pending review.

    Visit the deploys page to approve it

    Name Link
    🔨 Latest commit d4891a4

    @CLAassistant
    Copy link

    CLAassistant commented Apr 5, 2025

    CLA assistant check
    All committers have signed the CLA.

    Copy link
    Contributor

    qodo-merge-pro bot commented Apr 5, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Translation Needed

    The added note about Firefox profiles in the Chinese version is in English rather than Chinese. This content should be translated to maintain consistency with the rest of the document.

    **Note**:  If you want to use an existing firefox profile, you can pass in the path to that profile. Every time you
    run your program, Selenium will make a new copy of the profile and use it instead of your original one. The copies
    are not cleaned up explicitly by Selenium, they should eventually be cleaned up by the operating system. However,
    if you want to remove the copy explicitly, the path of the copy will be exposed by the `FirefoxProfile` object.
    Check the language specific implementation to see how to retrieve that location.
    
    Please refer to the official [Firefox documentation](https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data#w_how-do-i-find-my-profile)
    for instructions on how to find the directory of your profile.

    Copy link
    Contributor

    qodo-merge-pro bot commented Apr 5, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Translate content to Chinese

    The content in the Chinese version file is in English. Since this is a Chinese
    localization file (as indicated by the .zh-cn suffix), the added note should be
    translated to Chinese to maintain consistency with the rest of the document.

    website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md [142-146]

    -**Note**:  If you want to use an existing firefox profile, you can pass in the path to that profile. Every time you
    -run your program, Selenium will make a new copy of the profile and use it instead of your original one. The copies
    -are not cleaned up explicitly by Selenium, they should eventually be cleaned up by the operating system. However,
    -if you want to remove the copy explicitly, the path of the copy will be exposed by the `FirefoxProfile` object.
    -Check the language specific implementation to see how to retrieve that location.
    +**注意**:如果您想使用现有的Firefox配置文件,您可以传入该配置文件的路径。每次运行程序时,Selenium都会创建配置文件的新副本并使用它,而不是使用您的原始配置文件。这些副本不会被Selenium显式清理,它们最终应该由操作系统清理。但是,如果您想明确删除副本,可以通过`FirefoxProfile`对象获取副本的路径。请查看特定语言的实现,了解如何获取该位置。
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    __

    Why: This suggestion correctly identifies that English content was added to a Chinese localization file. Translating the content to Chinese is essential for maintaining proper localization and ensuring Chinese-speaking users can understand the documentation. This is a high-impact suggestion that addresses a clear inconsistency in the PR.

    High
    • Update

    @shbenzer
    Copy link
    Contributor

    shbenzer commented Apr 5, 2025

    Thanks for the PR! Could you please add this to each translation?

    @cgoldberg
    Copy link
    Contributor

    Just a small note.. this not only happens when you reuse an existing profile, but also if you use FirefoxProfile to generate a new profile (by not supplying a path).

    @Ozoniuss
    Copy link
    Contributor Author

    Ozoniuss commented Apr 6, 2025

    Thanks for the PR! Could you please add this to each translation?

    @shbenzer You mean just adding the content in English? I don't speak those languages so wouldn't be able to translate them. If I add them in English, would they be picked up by a translator?

    I only updated the zh-cn version because I saw it was also in English:)

    @Ozoniuss Ozoniuss force-pushed the add-firefox-profile-cleanup-instructions branch from 35311c0 to 7f3afa9 Compare April 6, 2025 10:41
    @titusfortner
    Copy link
    Member

    The way the translations currently work is that we put all the information in English on each of the translations and one of our translators will go through and update it with the translation.

    This extends the Firefox profile documentation by explaining how
    Selenium works when supplying an existing profile directory. Since
    profiles are not cleaned up by Selenium, it also describes how they can
    be explicitly removed by the user.
    @Ozoniuss Ozoniuss force-pushed the add-firefox-profile-cleanup-instructions branch from 7f3afa9 to 6a822b2 Compare April 6, 2025 15:36
    @Ozoniuss
    Copy link
    Contributor Author

    Ozoniuss commented Apr 6, 2025

    Should be ready for review again

    @cgoldberg
    Copy link
    Contributor

    This looks good to me... but I don't have merge access in this repo.

    Copy link
    Member

    @harsha509 harsha509 left a comment

    Choose a reason for hiding this comment

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

    Thank you @Ozoniuss !

    @harsha509
    Copy link
    Member

    Thank you @shbenzer , @cgoldberg , @titusfortner for the review!

    @harsha509 harsha509 merged commit 8945c9e into SeleniumHQ:trunk Apr 10, 2025
    3 checks passed
    @harsha509
    Copy link
    Member

    Congratulations on you first contribution to Selenium Docs @Ozoniuss 🎉 🎉 🎉 !

    selenium-ci added a commit that referenced this pull request Apr 10, 2025
    This extends the Firefox profile documentation by explaining how
    Selenium works when supplying an existing profile directory. Since
    profiles are not cleaned up by Selenium, it also describes how they can
    be explicitly removed by the user.
    
    Co-authored-by: Sri Harsha <[email protected]> 8945c9e
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    6 participants