Bug 1364877 - Fix support of string preferences with quotes in DevTools add-on. r=jdescottes
MozReview-Commit-ID: IO9aJwijMk0
--- a/devtools/bootstrap.js
+++ b/devtools/bootstrap.js
@@ -51,17 +51,19 @@ function processPrefFile(url) {
// Prevent overriding prefs that have been changed by the user
if (Services.prefs.prefHasUserValue(name)) {
return;
}
let defaultBranch = Services.prefs.getDefaultBranch("");
if ((val.startsWith("\"") && val.endsWith("\"")) ||
(val.startsWith("'") && val.endsWith("'"))) {
- defaultBranch.setCharPref(name, val.substr(1, val.length - 2));
+ val = val.substr(1, val.length - 2);
+ val = val.replace(/\\"/g, '"');
+ defaultBranch.setCharPref(name, val);
} else if (val.match(/[0-9]+/)) {
defaultBranch.setIntPref(name, parseInt(val, 10));
} else if (val == "true" || val == "false") {
defaultBranch.setBoolPref(name, val == "true");
} else {
console.log("Unable to match preference type for value:", val);
}
});