Add support for Firefox in a Snap for Ubuntu 22.04

Closes #327
Fixes #325
This commit is contained in:
Filippo Valsorda 2022-04-25 19:55:19 +02:00
parent 255b8304cd
commit 789f1b1c70
4 changed files with 11 additions and 5 deletions

View File

@ -16,7 +16,7 @@ import (
)
var (
FirefoxProfile = os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"
FirefoxProfiles = []string{os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"}
CertutilInstallHelp = "brew install nss"
NSSBrowsers = "Firefox"
)

View File

@ -15,8 +15,9 @@ import (
)
var (
FirefoxProfile = os.Getenv("HOME") + "/.mozilla/firefox/*"
NSSBrowsers = "Firefox and/or Chrome/Chromium"
FirefoxProfiles = []string{os.Getenv("HOME") + "/.mozilla/firefox/*",
os.Getenv("HOME") + "/snap/firefox/common/.mozilla/firefox/*"}
NSSBrowsers = "Firefox and/or Chrome/Chromium"
SystemTrustFilename string
SystemTrustCommand []string

View File

@ -27,6 +27,7 @@ var (
"/usr/bin/firefox",
"/usr/bin/firefox-nightly",
"/usr/bin/firefox-developer-edition",
"/snap/firefox",
"/Applications/Firefox.app",
"/Applications/FirefoxDeveloperEdition.app",
"/Applications/Firefox Developer Edition.app",
@ -128,8 +129,12 @@ func execCertutil(cmd *exec.Cmd) ([]byte, error) {
}
func (m *mkcert) forEachNSSProfile(f func(profile string)) (found int) {
profiles, _ := filepath.Glob(FirefoxProfile)
var profiles []string
profiles = append(profiles, nssDBs...)
for _, ff := range FirefoxProfiles {
pp, _ := filepath.Glob(ff)
profiles = append(profiles, pp...)
}
for _, profile := range profiles {
if stat, err := os.Stat(profile); err != nil || !stat.IsDir() {
continue

View File

@ -17,7 +17,7 @@ import (
)
var (
FirefoxProfile = os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"
FirefoxProfiles = []string{os.Getenv("USERPROFILE") + "\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles"}
CertutilInstallHelp = "" // certutil unsupported on Windows
NSSBrowsers = "Firefox"
)