Add support for Firefox in a Snap for Ubuntu 22.04
Closes #327 Fixes #325
This commit is contained in:
parent
255b8304cd
commit
789f1b1c70
@ -16,7 +16,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
FirefoxProfile = os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"
|
FirefoxProfiles = []string{os.Getenv("HOME") + "/Library/Application Support/Firefox/Profiles/*"}
|
||||||
CertutilInstallHelp = "brew install nss"
|
CertutilInstallHelp = "brew install nss"
|
||||||
NSSBrowsers = "Firefox"
|
NSSBrowsers = "Firefox"
|
||||||
)
|
)
|
||||||
|
@ -15,8 +15,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
FirefoxProfile = os.Getenv("HOME") + "/.mozilla/firefox/*"
|
FirefoxProfiles = []string{os.Getenv("HOME") + "/.mozilla/firefox/*",
|
||||||
NSSBrowsers = "Firefox and/or Chrome/Chromium"
|
os.Getenv("HOME") + "/snap/firefox/common/.mozilla/firefox/*"}
|
||||||
|
NSSBrowsers = "Firefox and/or Chrome/Chromium"
|
||||||
|
|
||||||
SystemTrustFilename string
|
SystemTrustFilename string
|
||||||
SystemTrustCommand []string
|
SystemTrustCommand []string
|
||||||
|
@ -27,6 +27,7 @@ var (
|
|||||||
"/usr/bin/firefox",
|
"/usr/bin/firefox",
|
||||||
"/usr/bin/firefox-nightly",
|
"/usr/bin/firefox-nightly",
|
||||||
"/usr/bin/firefox-developer-edition",
|
"/usr/bin/firefox-developer-edition",
|
||||||
|
"/snap/firefox",
|
||||||
"/Applications/Firefox.app",
|
"/Applications/Firefox.app",
|
||||||
"/Applications/FirefoxDeveloperEdition.app",
|
"/Applications/FirefoxDeveloperEdition.app",
|
||||||
"/Applications/Firefox Developer Edition.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) {
|
func (m *mkcert) forEachNSSProfile(f func(profile string)) (found int) {
|
||||||
profiles, _ := filepath.Glob(FirefoxProfile)
|
var profiles []string
|
||||||
profiles = append(profiles, nssDBs...)
|
profiles = append(profiles, nssDBs...)
|
||||||
|
for _, ff := range FirefoxProfiles {
|
||||||
|
pp, _ := filepath.Glob(ff)
|
||||||
|
profiles = append(profiles, pp...)
|
||||||
|
}
|
||||||
for _, profile := range profiles {
|
for _, profile := range profiles {
|
||||||
if stat, err := os.Stat(profile); err != nil || !stat.IsDir() {
|
if stat, err := os.Stat(profile); err != nil || !stat.IsDir() {
|
||||||
continue
|
continue
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
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
|
CertutilInstallHelp = "" // certutil unsupported on Windows
|
||||||
NSSBrowsers = "Firefox"
|
NSSBrowsers = "Firefox"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user