firefox-profile
Advanced tools
Comparing version 4.5.0 to 4.6.0
@@ -0,1 +1,5 @@ | ||
# 4.6.0 | ||
- Linux: add support for snap, flatpak and XDG_CONFIG_HOME firefox directory | ||
# 4.5.0 | ||
@@ -2,0 +6,0 @@ |
@@ -8,19 +8,57 @@ 'use strict'; | ||
function locateLinuxDirectory() { | ||
var userHomeDir = process.env.HOME; | ||
var homes = [ | ||
// look for a valid sandboxed profile directories | ||
path.join(userHomeDir, 'snap/firefox/common', '.mozilla/firefox'), | ||
path.join(userHomeDir, 'snap/firefox/common', '.config/mozilla/firefox'), | ||
path.join(userHomeDir, '.var/app/org.mozilla.firefox', '.mozilla/firefox'), | ||
path.join( | ||
userHomeDir, | ||
'.var/app/org.mozilla.firefox', | ||
'.config/mozilla/firefox' | ||
), | ||
]; | ||
// keep support for nodejs 12 | ||
for (var i = 0; i < homes.length; i++) { | ||
var dir = homes[i]; | ||
if (fs.existsSync(dir)) { | ||
return dir; | ||
} | ||
} | ||
// look in the next probable location | ||
const defaultLocation = path.join(userHomeDir, '.mozilla/firefox'); | ||
if (fs.existsSync(defaultLocation)) { | ||
return defaultLocation; | ||
} | ||
const configDir = path.join( | ||
process.env.XDG_CONFIG_HOME || path.join(userHomeDir, '.config'), | ||
'mozilla/firefox' | ||
); | ||
if (!fs.existsSync(configDir)) { | ||
console.warn('detected firefox profile directory:', configDir, 'not found'); | ||
} | ||
return configDir; | ||
} | ||
function locateUserDirectory(platform) { | ||
var userDir; | ||
switch (platform || os.platform()) { | ||
var platform = platform || os.platform(); | ||
switch (platform) { | ||
case 'darwin': | ||
userDir = path.join( | ||
return path.join( | ||
process.env.HOME, | ||
'/Library/Application Support/Firefox' | ||
); | ||
break; | ||
case 'linux': | ||
userDir = path.join(process.env.HOME, '/.mozilla/firefox'); | ||
break; | ||
return locateLinuxDirectory(); | ||
case 'win32': | ||
userDir = path.join(process.env.APPDATA, '/Mozilla/Firefox'); | ||
break; | ||
return path.join(process.env.APPDATA, '/Mozilla/Firefox'); | ||
default: | ||
throw new Error('unsupported platform ' + platform); | ||
} | ||
return userDir; | ||
} | ||
@@ -27,0 +65,0 @@ |
{ | ||
"name": "firefox-profile", | ||
"version": "4.5.0", | ||
"version": "4.6.0", | ||
"description": "firefox profile for selenium WebDriverJs, admc/wd or any other node selenium driver that supports capabilities", | ||
@@ -5,0 +5,0 @@ "main": "lib/firefox_profile", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48251
1009
8