firefox-profile
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -0,1 +1,9 @@ | ||
# 0.3.2 | ||
* modify some callback to follow the standard `(err, resp)` | ||
# 0.3.1 | ||
* ability to specify a destination directory | ||
# 0.2.13 | ||
@@ -2,0 +10,0 @@ |
@@ -18,4 +18,6 @@ /** | ||
getID = require('jetpack-id'), | ||
_ = require('lodash'); | ||
_ = require('lodash'), | ||
Finder = require('./profile_finder'); | ||
var config = { | ||
@@ -178,10 +180,28 @@ // from python... Not used | ||
if (!opts.profileDirectory) { | ||
throw new Error('firefoxProfile: .copy() requires destinationDirectory'); | ||
cb && cb(new Error('firefoxProfile: .copy() requires profileDirectory option')); | ||
return; | ||
} | ||
var profile = new FirefoxProfile({destinationDirectory: opts.destinationDirectory}); | ||
profile._copy(opts.profileDirectory, function() { | ||
cb && cb(profile); | ||
cb && cb(null, profile); | ||
}); | ||
}; | ||
FirefoxProfile.copyFromUserProfile = function(opts, cb) { | ||
if (!opts.name) { | ||
cb && cb(new Error('firefoxProfile: .copyFromUserProfile() requires a name options')); | ||
} | ||
var finder = new Finder(); | ||
finder.getPath(opts.name, function(err, profilePath) { | ||
if (err) { cb(err); return; } | ||
FirefoxProfile.copy({ | ||
destinationDirectory: opts.destinationDirectory, | ||
profileDirectory: profilePath | ||
}, cb); | ||
}); | ||
}; | ||
/** | ||
@@ -523,3 +543,3 @@ * Deletes the profile directory asynchronously. | ||
if (!addonId) { | ||
throw new Error('FirefoxProfile: the addon id could not be found!'); | ||
cb(new Error('FirefoxProfile: the addon id could not be found!')); | ||
} | ||
@@ -676,2 +696,4 @@ var addonPath = path.join(self.extensionsDir, path.sep, addonId); | ||
FirefoxProfile.Finder = Finder; | ||
module.exports = FirefoxProfile; |
{ | ||
"name": "firefox-profile", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "firefox profile for selenium WebDriverJs, admc/wd or any other node selenium driver that supports capabilities", | ||
@@ -49,4 +49,3 @@ "main": "lib/firefox_profile", | ||
"url": "https://github.com/pkuczynski" | ||
} | ||
, | ||
}, | ||
{ | ||
@@ -83,4 +82,5 @@ "name": "halo2376", | ||
"wrench": "~1.5.1", | ||
"xml2js": "~0.4.0" | ||
"xml2js": "~0.4.0", | ||
"ini": "~1.2.1" | ||
} | ||
} |
@@ -71,3 +71,3 @@ /*jshint camelcase:false*/ | ||
it('lock files should not be copied over', function(done) { | ||
FirefoxProfile.copy(testProfiles.emptyProfile.path, function(fp) { | ||
FirefoxProfile.copy(testProfiles.emptyProfile.path, function(err, fp) { | ||
expect(fs.statSync(fp.profileDir).isDirectory()).to.be.true; | ||
@@ -85,3 +85,3 @@ ['.parentlock', 'lock', 'parent.lock'].forEach(function(lockFile) { | ||
destinationDirectory: testProfiles.dest | ||
}, function(fp) { | ||
}, function(err, fp) { | ||
expect(fp.profileDir).to.be.equal(testProfiles.dest); | ||
@@ -88,0 +88,0 @@ expect(fs.statSync(fp.profileDir).isDirectory()).to.be.true; |
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 2 instances 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
6518991
36
1237
11
11
+ Addedini@~1.2.1
+ Addedini@1.2.1(transitive)