Bug 1371298 - trim values extracted from pref files in devtools addon prefs loader;r=bgrins
MozReview-Commit-ID: LuhOlYP4xYc
--- a/devtools/bootstrap.js
+++ b/devtools/bootstrap.js
@@ -91,17 +91,17 @@ function interpretPreprocessingInstructi
// Read a preference file and set all of its defined pref as default values
// (This replicates the behavior of preferences files from mozilla-central)
function processPrefFile(url) {
let content = readURI(url);
content = interpretPreprocessingInstructions(content);
content.match(/pref\("[^"]+",\s*.+\s*\)/g).forEach(item => {
let m = item.match(/pref\("([^"]+)",\s*(.+)\s*\)/);
let name = m[1];
- let val = m[2];
+ let val = m[2].trim();
// 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("'"))) {