@@ -852,6 +852,19 @@ def get_local_driver(
852
852
edge_options .add_experimental_option (
853
853
"mobileEmulation" , emulator_settings )
854
854
edge_options .add_argument ("--enable-sync" )
855
+ if user_data_dir :
856
+ abs_path = os .path .abspath (user_data_dir )
857
+ edge_options .add_argument ("user-data-dir=%s" % abs_path )
858
+ if extension_zip :
859
+ # Can be a comma-separated list of .ZIP or .CRX files
860
+ extension_zip_list = extension_zip .split (',' )
861
+ for extension_zip_item in extension_zip_list :
862
+ abs_path = os .path .abspath (extension_zip_item )
863
+ edge_options .add_extension (abs_path )
864
+ if extension_dir :
865
+ # load-extension input can be a comma-separated list
866
+ abs_path = os .path .abspath (extension_dir )
867
+ edge_options .add_argument ("--load-extension=%s" % abs_path )
855
868
edge_options .add_argument ("--disable-infobars" )
856
869
edge_options .add_argument ("--disable-save-password-bubble" )
857
870
edge_options .add_argument ("--disable-single-click-autofill" )
@@ -865,7 +878,16 @@ def get_local_driver(
865
878
edge_options .add_argument ("--dom-automation" )
866
879
edge_options .add_argument ("--disable-hang-monitor" )
867
880
edge_options .add_argument ("--disable-prompt-on-repost" )
881
+ if (settings .DISABLE_CSP_ON_CHROME or disable_csp ) and (
882
+ not headless ):
883
+ # Headless Edge doesn't support extensions, which are required
884
+ # for disabling the Content Security Policy on Edge
885
+ edge_options = _add_chrome_disable_csp_extension (edge_options )
886
+ edge_options .add_argument ("--enable-sync" )
868
887
if proxy_string :
888
+ if proxy_auth :
889
+ edge_options = _add_chrome_proxy_extension (
890
+ edge_options , proxy_string , proxy_user , proxy_pass )
869
891
edge_options .add_argument ('--proxy-server=%s' % proxy_string )
870
892
edge_options .add_argument ("--test-type" )
871
893
edge_options .add_argument ("--log-level=3" )
0 commit comments