Skip to content

Commit 7f3afa9

Browse files
committed
Explain how Firefox uses user profiles
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.
1 parent a2be111 commit 7f3afa9

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

Diff for: website_and_docs/content/documentation/webdriver/browsers/firefox.en.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,16 @@ options.profile = FirefoxProfile()
135135
driver = FirefoxDriver(options)
136136
{{< /tab >}}
137137
{{< /tabpane >}}
138-
138+
**Note**: Whether you create an empty `FirefoxProfile` or point it to the directory of your own profile, Selenium
139+
will create a temporary directory to store either the data of the new profile or a copy of your existing one. Every
140+
time you run your program, a different temporary directory will be created. These directories are not cleaned up
141+
explicitly by Selenium, they should eventually get removed by the operating system. However, if you want to remove
142+
the copy manually (e.g. if your profile is large in size), the path of the copy is exposed by the `FirefoxProfile`
143+
object. Check the language specific implementation to see how to retrieve that location.
144+
145+
If you want to use an existing Firefox profile, you can pass in the path to that profile. Please refer to the official
146+
[Firefox documentation](https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data#w_how-do-i-find-my-profile)
147+
for instructions on how to find the directory of your profile.
139148

140149
## Service
141150

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

+10
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,16 @@ driver = RemoteWebDriver(options)
139139
{{< /tabpane >}}
140140
</div>
141141

142+
**Note**: Whether you create an empty `FirefoxProfile` or point it to the directory of your own profile, Selenium
143+
will create a temporary directory to store either the data of the new profile or a copy of your existing one. Every
144+
time you run your program, a different temporary directory will be created. These directories are not cleaned up
145+
explicitly by Selenium, they should eventually get removed by the operating system. However, if you want to remove
146+
the copy manually (e.g. if your profile is large in size), the path of the copy is exposed by the `FirefoxProfile`
147+
object. Check the language specific implementation to see how to retrieve that location.
148+
149+
If you want to use an existing Firefox profile, you can pass in the path to that profile. Please refer to the official
150+
[Firefox documentation](https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data#w_how-do-i-find-my-profile)
151+
for instructions on how to find the directory of your profile.
142152

143153
## Service
144154

0 commit comments

Comments
 (0)