I observed that when one initiates a new firefox Browsing Context using Selenium from an existing FirefoxProfile, the settings/configurations are copied from the actual profile directory into a temporary rust_mozprofile as discussed in this response:
mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\P\\AppData\\Local\\Temp\\rust_mozprofile.xxxxxxxxx"
Since this causes a long delay in starting up Firefox, I was wondering about the origin/reason of this behavior.
I came across the following explanation by @JimEvans:
The main reason that the Firefox driver uses a temporary profile is to support the use case of running multiple independent simultaneous instances of Firefox. At one time, when Firefox launched, it would drop a sentinel or lock file in the profile directory, and would detect that file if the user attempted to start a new instance of Firefox, preventing them from doing so. Whether or not Firefox still exhibits this behavior, the driver still has to work with some older versions of the browser, and has to account for it. The Selenium project's solution to that issue with WebDriver, when a user wants to use a specific profile, is to copy the contents of that profile to a new directory, and launch Firefox pointing to the copy.
Based on the above, is there any reason to first generate a copy of FF profile before launching Firefox in the current/latest version of FF? Or since the concept of file lock no longer exists it would be better simply to use the original profile?
Is there anything gained by making a copy of the FF profile as of 2022?
Thanks