Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

firefox-profile

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

firefox-profile - npm Package Compare versions

Comparing version 4.3.2 to 4.4.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# 4.4.0
- bug fix: return after invoking callback ([web-ext issue](https://github.com/mozilla/web-ext/issues/2826#issuecomment-1739150954))
# 4.3.2

@@ -2,0 +6,0 @@

64

lib/profile_finder.js
'use strict';
var os = require('os'),
fs = require('fs'),
path = require('path'),
var os = require('os'),
fs = require('fs'),
path = require('path'),
ini = require('ini');
ini = require('ini');
function locateUserDirectory(platform) {

@@ -14,3 +12,6 @@ var userDir;

case 'darwin':
userDir = path.join(process.env.HOME, '/Library/Application Support/Firefox');
userDir = path.join(
process.env.HOME,
'/Library/Application Support/Firefox'
);
break;

@@ -45,3 +46,2 @@ case 'linux':

/**

@@ -53,16 +53,25 @@ * Reads profiles info and stores it in this.profiles.

*/
ProfileFinder.prototype.readProfiles = function(cb) {
if (this.hasReadProfiles) { cb(null, this.profiles); }
ProfileFinder.prototype.readProfiles = function (cb) {
if (this.hasReadProfiles) {
cb(null, this.profiles);
}
var self = this;
fs.readFile(path.join(this.directory, 'profiles.ini'), {encoding: 'utf8'}, function(err, data) {
if (err) { cb(err); }
Object.entries(ini.parse(data)).forEach(function ([key, value]) {
if (typeof key === 'string' && key.match(/^Profile/)) {
self.profiles.push(value);
fs.readFile(
path.join(this.directory, 'profiles.ini'),
{ encoding: 'utf8' },
function (err, data) {
if (err) {
cb(err);
return;
}
});
self.hasReadProfiles = true;
cb(null, self.profiles);
});
Object.entries(ini.parse(data)).forEach(function ([key, value]) {
if (typeof key === 'string' && key.match(/^Profile/)) {
self.profiles.push(value);
}
});
self.hasReadProfiles = true;
cb(null, self.profiles);
}
);
};

@@ -77,17 +86,20 @@

*/
ProfileFinder.prototype.getPath = function(name, cb) {
ProfileFinder.prototype.getPath = function (name, cb) {
var self = this;
function findInProfiles(name, cb) {
var pathFound,
found = self.profiles.find(function(profile) {
return profile.Name === name;
});
found = self.profiles.find(function (profile) {
return profile.Name === name;
});
if (found) {
pathFound = found.IsRelative ? path.join(self.directory, found.Path) : found.Path;
pathFound = found.IsRelative
? path.join(self.directory, found.Path)
: found.Path;
}
cb && cb(found ? null : new Error('cannot find profile ' + name), pathFound);
cb &&
cb(found ? null : new Error('cannot find profile ' + name), pathFound);
return pathFound;
}
if (!this.hasReadProfiles) {
this.readProfiles(function() {
this.readProfiles(function () {
findInProfiles(name, cb);

@@ -94,0 +106,0 @@ });

{
"name": "firefox-profile",
"version": "4.3.2",
"version": "4.4.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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc