Skip to content

Commit

Permalink
Merge pull request #49 from pinf-to/parse-user-prefs
Browse files Browse the repository at this point in the history
fix existing user preferences parsing
  • Loading branch information
saadtazi committed Mar 10, 2015
2 parents 43fe52d + 4a36b7d commit be93956
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/firefox_profile.js
Expand Up @@ -513,11 +513,11 @@ FirefoxProfile.prototype._writeUserPrefs = function(userPrefs) {

FirefoxProfile.prototype._readExistingUserjs = function() {
var self = this,
regExp = /user_pref\('(.*)',\s(.*)\)/,
contentLines = fs.readFileSync(this.userPrefs).split('\n');
regExp = /user_pref\(['"](.*)["'],\s*['"]?(.*)["']?\)/,
contentLines = fs.readFileSync(this.userPrefs, "utf8").split('\n');
contentLines.forEach(function(line) {
var found = line.match(regExp);
if (found[1]) {
if (found) {
self.defaultPreferences[found[1]] = found[2];
}
});
Expand Down

0 comments on commit be93956

Please sign in to comment.