Skip to content

Commit fc3c75d

Browse files
authored
Merge pull request #3172 from seleniumbase/update-firefox-settings
Update Firefox options and settings
2 parents 36f229b + 90f06f4 commit fc3c75d

File tree

6 files changed

+23
-14
lines changed

6 files changed

+23
-14
lines changed

examples/test_download_files.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ def test_download_files_from_pypi(self):
5252
self.download_file(whl_href)
5353
self.download_file(tar_href)
5454
else:
55-
self.click(whl_selector) # Download the "whl" file
55+
self.js_click(whl_selector) # Download the "whl" file
5656
self.sleep(0.1)
57-
self.click(tar_selector) # Download the "tar" file
57+
self.js_click(tar_selector) # Download the "tar" file
5858

5959
# Verify that the downloaded files appear in the [Downloads Folder]
6060
# (This only guarantees that the exact file name is in the folder.)

mkdocs_build/requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Minimum Python version: 3.8 (for generating docs only)
33

44
regex>=2024.9.11
5-
pymdown-extensions>=10.10.2
5+
pymdown-extensions>=10.11.2
66
pipdeptree>=2.23.4
77
python-dateutil>=2.8.2
88
Markdown==3.7
@@ -11,7 +11,7 @@ MarkupSafe==2.1.5
1111
Jinja2==3.1.4
1212
click==8.1.7
1313
ghp-import==2.1.0
14-
watchdog==5.0.2
14+
watchdog==5.0.3
1515
cairocffi==1.7.1
1616
pathspec==0.12.1
1717
Babel==2.16.0
@@ -20,7 +20,7 @@ lxml==5.3.0
2020
pyquery==2.0.1
2121
readtime==3.0.0
2222
mkdocs==1.6.1
23-
mkdocs-material==9.5.38
23+
mkdocs-material==9.5.39
2424
mkdocs-exclude-search==0.6.6
2525
mkdocs-simple-hooks==0.1.5
2626
mkdocs-material-extensions==1.3.1

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pyotp==2.9.0
5555
python-xlib==0.33;platform_system=="Linux"
5656
markdown-it-py==3.0.0
5757
mdurl==0.1.2
58-
rich==13.8.1
58+
rich==13.9.1
5959

6060
# --- Testing Requirements --- #
6161
# ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.)

seleniumbase/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.31.2"
2+
__version__ = "4.31.3"

seleniumbase/core/browser_launcher.py

+15-6
Original file line numberDiff line numberDiff line change
@@ -2024,6 +2024,7 @@ def _set_firefox_options(
20242024
disable_csp,
20252025
firefox_arg,
20262026
firefox_pref,
2027+
external_pdf,
20272028
):
20282029
blank_p = "about:blank"
20292030
options = webdriver.FirefoxOptions()
@@ -2035,7 +2036,6 @@ def _set_firefox_options(
20352036
options.set_preference("browser.newtab.url", blank_p)
20362037
options.set_preference("trailhead.firstrun.branches", "nofirstrun-empty")
20372038
options.set_preference("browser.aboutwelcome.enabled", False)
2038-
options.set_preference("pdfjs.disabled", True)
20392039
options.set_preference("app.update.auto", False)
20402040
options.set_preference("app.update.enabled", False)
20412041
options.set_preference("browser.formfill.enable", False)
@@ -2122,13 +2122,20 @@ def _set_firefox_options(
21222122
options.set_preference(
21232123
"browser.helperApps.neverAsk.saveToDisk",
21242124
(
2125-
"application/pdf, application/zip, application/octet-stream, "
2126-
"text/csv, text/xml, application/xml, text/plain, "
2127-
"text/octet-stream, application/x-gzip, application/x-tar "
2128-
"application/"
2129-
"vnd.openxmlformats-officedocument.spreadsheetml.sheet"
2125+
"application/pdf,application/zip,application/octet-stream,"
2126+
"text/csv,text/xml,application/xml,text/plain,application/json,"
2127+
"text/octet-stream,application/x-gzip,application/x-tar,"
2128+
"application/java-archive,text/x-java-source,java,"
2129+
"application/javascript,video/jpeg,audio/x-aac,image/svg+xml,"
2130+
"application/x-font-woff,application/x-7z-compressed,"
2131+
"application/mp4,video/mp4,audio/mp4,video/x-msvideo,"
2132+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
21302133
),
21312134
)
2135+
if external_pdf:
2136+
options.set_preference("pdfjs.disabled", True)
2137+
else:
2138+
options.set_preference("pdfjs.disabled", False)
21322139
if firefox_arg:
21332140
# Can be a comma-separated list of Firefox args
21342141
firefox_arg_list = firefox_arg.split(",")
@@ -2768,6 +2775,7 @@ def get_remote_driver(
27682775
disable_csp,
27692776
firefox_arg,
27702777
firefox_pref,
2778+
external_pdf,
27712779
)
27722780
capabilities = webdriver.FirefoxOptions().to_capabilities()
27732781
capabilities["marionette"] = True
@@ -3050,6 +3058,7 @@ def get_local_driver(
30503058
disable_csp,
30513059
firefox_arg,
30523060
firefox_pref,
3061+
external_pdf,
30533062
)
30543063
if LOCAL_GECKODRIVER and os.path.exists(LOCAL_GECKODRIVER):
30553064
try:

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@
204204
'python-xlib==0.33;platform_system=="Linux"',
205205
'markdown-it-py==3.0.0',
206206
'mdurl==0.1.2',
207-
'rich==13.8.1',
207+
'rich==13.9.1',
208208
],
209209
extras_require={
210210
# pip install -e .[allure]

0 commit comments

Comments
 (0)