File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -175,12 +175,22 @@ def _set_chrome_options(
175
175
chrome_options .add_experimental_option (
176
176
"mobileEmulation" , emulator_settings )
177
177
chrome_options .add_argument ("--enable-sync" )
178
- if incognito :
179
- chrome_options .add_argument ("--incognito" )
180
- elif guest_mode :
181
- chrome_options .add_argument ("--guest" )
182
- else :
183
- pass
178
+ if not proxy_auth and not disable_csp and (
179
+ not extension_zip and not extension_dir ):
180
+ if incognito :
181
+ # Use Chrome's Incognito Mode
182
+ # Incognito Mode prevents Chrome extensions from loading,
183
+ # so if using extensions or a feature that uses extensions,
184
+ # then Chrome's Incognito mode will be disabled instead.
185
+ chrome_options .add_argument ("--incognito" )
186
+ elif guest_mode :
187
+ # Use Chrome's Guest Mode
188
+ # Guest mode prevents Chrome extensions from loading,
189
+ # so if using extensions or a feature that uses extensions,
190
+ # then Chrome's Guest Mode will be disabled instead.
191
+ chrome_options .add_argument ("--guest" )
192
+ else :
193
+ pass
184
194
if user_data_dir :
185
195
abs_path = os .path .abspath (user_data_dir )
186
196
chrome_options .add_argument ("user-data-dir=%s" % abs_path )
You can’t perform that action at this time.
0 commit comments