Skip to content

Update Firefox options and settings #3172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/test_download_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def test_download_files_from_pypi(self):
self.download_file(whl_href)
self.download_file(tar_href)
else:
self.click(whl_selector) # Download the "whl" file
self.js_click(whl_selector) # Download the "whl" file
self.sleep(0.1)
self.click(tar_selector) # Download the "tar" file
self.js_click(tar_selector) # Download the "tar" file

# Verify that the downloaded files appear in the [Downloads Folder]
# (This only guarantees that the exact file name is in the folder.)
Expand Down
6 changes: 3 additions & 3 deletions mkdocs_build/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Minimum Python version: 3.8 (for generating docs only)

regex>=2024.9.11
pymdown-extensions>=10.10.2
pymdown-extensions>=10.11.2
pipdeptree>=2.23.4
python-dateutil>=2.8.2
Markdown==3.7
Expand All @@ -11,7 +11,7 @@ MarkupSafe==2.1.5
Jinja2==3.1.4
click==8.1.7
ghp-import==2.1.0
watchdog==5.0.2
watchdog==5.0.3
cairocffi==1.7.1
pathspec==0.12.1
Babel==2.16.0
Expand All @@ -20,7 +20,7 @@ lxml==5.3.0
pyquery==2.0.1
readtime==3.0.0
mkdocs==1.6.1
mkdocs-material==9.5.38
mkdocs-material==9.5.39
mkdocs-exclude-search==0.6.6
mkdocs-simple-hooks==0.1.5
mkdocs-material-extensions==1.3.1
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pyotp==2.9.0
python-xlib==0.33;platform_system=="Linux"
markdown-it-py==3.0.0
mdurl==0.1.2
rich==13.8.1
rich==13.9.1

# --- Testing Requirements --- #
# ("pip install -r requirements.txt" also installs this, but "pip install -e ." won't.)
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.31.2"
__version__ = "4.31.3"
21 changes: 15 additions & 6 deletions seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2024,6 +2024,7 @@ def _set_firefox_options(
disable_csp,
firefox_arg,
firefox_pref,
external_pdf,
):
blank_p = "about:blank"
options = webdriver.FirefoxOptions()
Expand All @@ -2035,7 +2036,6 @@ def _set_firefox_options(
options.set_preference("browser.newtab.url", blank_p)
options.set_preference("trailhead.firstrun.branches", "nofirstrun-empty")
options.set_preference("browser.aboutwelcome.enabled", False)
options.set_preference("pdfjs.disabled", True)
options.set_preference("app.update.auto", False)
options.set_preference("app.update.enabled", False)
options.set_preference("browser.formfill.enable", False)
Expand Down Expand Up @@ -2122,13 +2122,20 @@ def _set_firefox_options(
options.set_preference(
"browser.helperApps.neverAsk.saveToDisk",
(
"application/pdf, application/zip, application/octet-stream, "
"text/csv, text/xml, application/xml, text/plain, "
"text/octet-stream, application/x-gzip, application/x-tar "
"application/"
"vnd.openxmlformats-officedocument.spreadsheetml.sheet"
"application/pdf,application/zip,application/octet-stream,"
"text/csv,text/xml,application/xml,text/plain,application/json,"
"text/octet-stream,application/x-gzip,application/x-tar,"
"application/java-archive,text/x-java-source,java,"
"application/javascript,video/jpeg,audio/x-aac,image/svg+xml,"
"application/x-font-woff,application/x-7z-compressed,"
"application/mp4,video/mp4,audio/mp4,video/x-msvideo,"
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
),
)
if external_pdf:
options.set_preference("pdfjs.disabled", True)
else:
options.set_preference("pdfjs.disabled", False)
if firefox_arg:
# Can be a comma-separated list of Firefox args
firefox_arg_list = firefox_arg.split(",")
Expand Down Expand Up @@ -2768,6 +2775,7 @@ def get_remote_driver(
disable_csp,
firefox_arg,
firefox_pref,
external_pdf,
)
capabilities = webdriver.FirefoxOptions().to_capabilities()
capabilities["marionette"] = True
Expand Down Expand Up @@ -3050,6 +3058,7 @@ def get_local_driver(
disable_csp,
firefox_arg,
firefox_pref,
external_pdf,
)
if LOCAL_GECKODRIVER and os.path.exists(LOCAL_GECKODRIVER):
try:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
'python-xlib==0.33;platform_system=="Linux"',
'markdown-it-py==3.0.0',
'mdurl==0.1.2',
'rich==13.8.1',
'rich==13.9.1',
],
extras_require={
# pip install -e .[allure]
Expand Down