From 0d270fe2c31cfd2c4576ea0dd56aefe14505bf97 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Tue, 6 Sep 2022 16:52:06 -0400 Subject: [PATCH] Fix issue with loading a Chrome extension dir on Windows --- seleniumbase/core/browser_launcher.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/seleniumbase/core/browser_launcher.py b/seleniumbase/core/browser_launcher.py index 657b4fb5..3ddac4e5 100755 --- a/seleniumbase/core/browser_launcher.py +++ b/seleniumbase/core/browser_launcher.py @@ -278,9 +278,13 @@ def add_chrome_ext_dir(chrome_options, dir_path): if arg.startswith("--load-extension="): option_exists = True chrome_options.arguments.remove(arg) - chrome_options.add_argument("%s,%s" % (arg, dir_path)) + chrome_options.add_argument( + "%s,%s" % (arg, os.path.realpath(dir_path)) + ) if not option_exists: - chrome_options.add_argument("--load-extension=%s" % dir_path) + chrome_options.add_argument( + "--load-extension=%s" % os.path.realpath(dir_path) + ) return chrome_options