[FIX] script selenium: support snap firefox for Ubuntu
This commit is contained in:
parent
621670e7c9
commit
273763a4fb
1 changed files with 11 additions and 4 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in a new issue