Skip to content

Commit 0d9e276

Browse files
committed
Prevent download prompts from appearing
1 parent 54410d9 commit 0d9e276

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

seleniumbase/core/browser_launcher.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ def _set_chrome_options(
145145
"safebrowsing.enabled": False,
146146
"safebrowsing.disable_download_protection": True,
147147
"profile": {
148-
"password_manager_enabled": False
148+
"password_manager_enabled": False,
149+
"default_content_setting_values.automatic_downloads": 1
149150
}
150151
}
151152
if locale_code:
@@ -349,11 +350,14 @@ def _create_firefox_profile(
349350
"browser.download.animateNotifications", False)
350351
profile.set_preference("browser.download.dir", downloads_path)
351352
profile.set_preference("browser.download.folderList", 2)
353+
profile.set_preference("browser.helperApps.alwaysAsk.force", False)
354+
profile.set_preference(
355+
"browser.download.manager.showWhenStarting", False)
352356
profile.set_preference(
353357
"browser.helperApps.neverAsk.saveToDisk",
354358
("application/pdf, application/zip, application/octet-stream, "
355359
"text/csv, text/xml, application/xml, text/plain, "
356-
"text/octet-stream, "
360+
"text/octet-stream, application/x-gzip, application/x-tar "
357361
"application/"
358362
"vnd.openxmlformats-officedocument.spreadsheetml.sheet"))
359363
return profile
@@ -761,7 +765,8 @@ def get_local_driver(
761765
"safebrowsing.enabled": False,
762766
"safebrowsing.disable_download_protection": True,
763767
"profile": {
764-
"password_manager_enabled": False
768+
"password_manager_enabled": False,
769+
"default_content_setting_values.automatic_downloads": 1
765770
}
766771
}
767772
if locale_code:

0 commit comments

Comments
 (0)