From 273763a4fb49533a3e62099bc691814f2056d731 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Thu, 5 Feb 2026 12:26:29 -0500 Subject: [PATCH] [FIX] script selenium: support snap firefox for Ubuntu --- script/selenium/selenium_lib.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/script/selenium/selenium_lib.py b/script/selenium/selenium_lib.py index 8f8452f..9bb41fd 100644 --- a/script/selenium/selenium_lib.py +++ b/script/selenium/selenium_lib.py @@ -13,6 +13,7 @@ import sys import tempfile import time import tkinter as tk +from pathlib import Path from tkinter import filedialog from pykeepass import PyKeePass @@ -226,10 +227,16 @@ class SeleniumLib(object): self.config.firefox_binary_path ) elif not self.config.use_network: - status_location = subprocess.check_output( - ["which", "firefox"], text=True - ).strip() - firefox_options.binary_location = status_location + # test snap firefox for Ubuntu first + snap_firefox_path = "/snap/bin/firefox" + firefox_path_exist = Path(snap_firefox_path).exists() + if firefox_path_exist: + firefox_options.binary_location = snap_firefox_path + else: + status_location = subprocess.check_output( + ["which", "firefox"], text=True + ).strip() + firefox_options.binary_location = status_location firefox_profile = webdriver.FirefoxProfile() firefox_profile.set_preference(