aaltat: To fully fix the #1332 needs #1393 because they are sharing part of the code.
diff --git a/src/SeleniumLibrary/keywords/browsermanagement.py b/src/SeleniumLibrary/keywords/browsermanagement.py
index 355d0cea..9d4c6d89 100644
--- a/src/SeleniumLibrary/keywords/browsermanagement.py
+++ b/src/SeleniumLibrary/keywords/browsermanagement.py
@@ -115,7 +115,9 @@ class BrowserManagementKeywords(LibraryComponent):
         Optional ``ff_profile_dir`` is the path to the Firefox profile
         directory if you wish to overwrite the default profile Selenium
         uses. Notice that prior to SeleniumLibrary 3.0, the library
-        contained its own profile that was used by default.
+        contained its own profile that was used by default. The
+        ``ff_profile_dir`` can also be instance of the
+        [https://seleniumhq.github.io/selenium/docs/api/py/webdriver_firefox/selenium.webdriver.firefox.firefox_profile.html?highlight=firefoxprofile#selenium.webdriver.firefox.firefox_profile.FirefoxProfile|selenium.webdriver.FirefoxProfile].
 
         Optional ``service_log_path`` argument defines the name of the
         file where to write the browser driver logs. If the
@@ -149,7 +151,9 @@ class BrowserManagementKeywords(LibraryComponent):
 
         Using ``alias`` to decide, is the new browser opened is new
         in SeleniumLibrary 4.0. Also the ``service_log_path`` is new
-        in SeleniumLibrary 4.0.
+        in SeleniumLibrary 4.0. Support for ``ff_profile_dir`` accepting
+        instance of the `selenium.webdriver.FirefoxProfile` is new in
+        SeleniumLibrary 4.0.
         """
         index = self.drivers.get_index(alias)
         if index:
diff --git a/src/SeleniumLibrary/keywords/webdrivertools.py b/src/SeleniumLibrary/keywords/webdrivertools.py
index 23ab2fbe..68c3e584 100644
--- a/src/SeleniumLibrary/keywords/webdrivertools.py
+++ b/src/SeleniumLibrary/keywords/webdrivertools.py
@@ -20,6 +20,7 @@ import warnings
 from robot.api import logger
 from robot.utils import ConnectionCache
 from selenium import webdriver
+from selenium.webdriver import FirefoxProfile
 
 from SeleniumLibrary.utils import is_falsy, is_truthy, is_noney
 
@@ -122,6 +123,8 @@ class WebDriverCreator(object):
                                  **desired_capabilities)
 
     def _get_ff_profile(self, ff_profile_dir):
+        if isinstance(ff_profile_dir, FirefoxProfile):
+            return ff_profile_dir
         if is_falsy(ff_profile_dir):
             return webdriver.FirefoxProfile()
         return webdriver.FirefoxProfile(ff_profile_dir)

Add better support for FireFox Profile class
Currently `Open Browser` keywords supports Firefox profile by taking in a string which points to the Firefox profile in the file system. Either users creates a profile by using Firefox and saving the profile with their test automation code or the use Python and use [FireFox FirefoxProfile](https://seleniumhq.github.io/selenium/docs/api/py/webdriver_firefox/selenium.webdriver.firefox.firefox_profile.html#selenium.webdriver.firefox.firefox_profile.FirefoxProfile) class to create new profile. 

But it might be better to allow users to create a Firefox profile with the `Open Browser` keyword in a SeleniumLibrary. There are few usage cases which needs support: 
1. Allow use existing profile as a base: Same as `FirefoxProfile('/path/to/profile_dir')`
2. Allow to extension with [add_extension](https://seleniumhq.github.io/selenium/docs/api/py/webdriver_firefox/selenium.webdriver.firefox.firefox_profile.html#selenium.webdriver.firefox.firefox_profile.FirefoxProfile.add_extension) method
3. Allow to [set preferences](https://seleniumhq.github.io/selenium/docs/api/py/webdriver_firefox/selenium.webdriver.firefox.firefox_profile.html#selenium.webdriver.firefox.firefox_profile.FirefoxProfile.set_preference)
4. Allow [adding proxy](https://seleniumhq.github.io/selenium/docs/api/py/webdriver_firefox/selenium.webdriver.firefox.firefox_profile.html#selenium.webdriver.firefox.firefox_profile.FirefoxProfile.set_proxy)
5. Support also FirefoxProfile instance. 

keywords signature would be something like this: 
```
| ${profile} = | Open Browser |  https://robotframework.org | Firefox | profile_dir=add_extension:/path/to/ext1,add_extension:/path/to/ext2 | 
```

This issue is splitting the work of the #701

diff --git a/utest/test/keywords/test_webdrivercreator.py b/utest/test/keywords/test_webdrivercreator.py
index 65bb0eba..e2afbcbf 100644
--- a/utest/test/keywords/test_webdrivercreator.py
+++ b/utest/test/keywords/test_webdrivercreator.py
@@ -186,6 +186,24 @@ class WebDriverCreatorTests(unittest.TestCase):
         self.assertEqual(driver, expected_webdriver)
         verify(webdriver).FirefoxProfile()
 
+    def test_get_ff_profile_real_path(self):
+        profile_path = '/path/to/profile'
+        profile_mock = mock()
+        when(webdriver).FirefoxProfile(profile_path).thenReturn(profile_mock)
+        profile = self.creator._get_ff_profile(profile_path)
+        self.assertEqual(profile, profile_mock)
+
+    def test_get_ff_profile_no_path(self):
+        profile_mock = mock()
+        when(webdriver).FirefoxProfile().thenReturn(profile_mock)
+        profile = self.creator._get_ff_profile(None)
+        self.assertEqual(profile, profile_mock)
+
+    def test_get_ff_profile_instance_FirefoxProfile(self):
+        input_profile = webdriver.FirefoxProfile()
+        profile = self.creator._get_ff_profile(input_profile)
+        self.assertEqual(profile, input_profile)
+
     def test_firefox_remote_no_caps(self):
         url = 'http://localhost:4444/wd/hub'
         profile = mock()

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
3.9
requirements.txt requirements-dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
allpairspy==2.5.1
approval_utilities==14.3.1
approvaltests==14.3.1
attrs==25.3.0
beautifulsoup4==4.13.3
certifi==2025.1.31
charset-normalizer==3.4.1
empty-files==0.0.9
exceptiongroup==1.2.2
h11==0.14.0
idna==3.10
iniconfig==2.1.0
mock==5.2.0
mockito==1.5.4
mrjob==0.7.4
outcome==1.3.0.post0
packaging==24.2
pluggy==1.5.0
pyperclip==1.9.0
PySocks==1.7.1
pytest==8.3.5
PyYAML==6.0.2
requests==2.32.3
robotframework==7.2.2
-e git+https://github.com/robotframework/SeleniumLibrary.git@de3d1aa650d9650bcd5c67f95ba9ecbcd7022970#egg=robotframework_seleniumlibrary
robotstatuschecker==4.1.1
selenium==4.30.0
sniffio==1.3.1
sortedcontainers==2.4.0
soupsieve==2.6
testfixtures==8.3.0
tomli==2.2.1
trio==0.29.0
trio-websocket==0.12.2
typing_extensions==4.13.0
urllib3==2.3.0
websocket-client==1.8.0
wsproto==1.2.0

name: SeleniumLibrary
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - allpairspy==2.5.1
      - approval-utilities==14.3.1
      - approvaltests==14.3.1
      - attrs==25.3.0
      - beautifulsoup4==4.13.3
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - empty-files==0.0.9
      - exceptiongroup==1.2.2
      - h11==0.14.0
      - idna==3.10
      - iniconfig==2.1.0
      - mock==5.2.0
      - mockito==1.5.4
      - mrjob==0.7.4
      - outcome==1.3.0.post0
      - packaging==24.2
      - pluggy==1.5.0
      - pyperclip==1.9.0
      - pysocks==1.7.1
      - pytest==8.3.5
      - pyyaml==6.0.2
      - requests==2.32.3
      - robotframework==7.2.2
      - robotstatuschecker==4.1.1
      - selenium==4.30.0
      - sniffio==1.3.1
      - sortedcontainers==2.4.0
      - soupsieve==2.6
      - testfixtures==8.3.0
      - tomli==2.2.1
      - trio==0.29.0
      - trio-websocket==0.12.2
      - typing-extensions==4.13.0
      - urllib3==2.3.0
      - websocket-client==1.8.0
      - wsproto==1.2.0
prefix: /opt/conda/envs/SeleniumLibrary

utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_get_ff_profile_instance_FirefoxProfile
utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_android utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_android_no_browser_name utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_chrome utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_chrome_healdless utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_chrome_healdless_with_grid utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_chrome_remote_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_chrome_remote_caps_no_browser_name utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_chrome_remote_no_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_chrome_with_desired_capabilities utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_create_driver_chrome utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_create_driver_firefox utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_edge utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_edge_no_browser_name utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_edge_remote_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_edge_remote_no_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_firefox utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_firefox_headless utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_firefox_healdless_with_grid_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_firefox_healdless_with_grid_no_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_firefox_profile utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_firefox_remote_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_firefox_remote_caps_no_browsername utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_firefox_remote_no_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_htmlunit_no_browser_name utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_htmlunit_no_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_htmlunit_remote_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_htmlunit_with_js utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_htmlunit_with_js_no_browser_name utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_ie utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_ie_no_browser_name utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_ie_remote_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_ie_remote_no_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_iphone utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_iphone_no_browser_name utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_opera utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_opera_no_browser_name utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_opera_remote_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_opera_remote_no_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_phantomjs utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_phantomjs_no_browser_name utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_phantomjs_remote_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_phantomjs_remote_no_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_safari_no_broser_name utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_safari_remote_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_safari_remote_no_caps
utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_capabilities_resolver_chrome utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_capabilities_resolver_firefox utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_capabilities_resolver_no_set_caps utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_create_driver_ie utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_get_creator_method utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_get_ff_profile_no_path utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_get_ff_profile_real_path utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_parse_capabilities utest/test/keywords/test_webdrivercreator.py::WebDriverCreatorTests::test_safari
src/SeleniumLibrary/keywords/browsermanagement.py src/SeleniumLibrary/keywords/webdrivertools.py
src/SeleniumLibrary/keywords/browsermanagement.py src/SeleniumLibrary/keywords/webdrivertools.py