Bug 1371298 - trim values extracted from pref files in devtools addon prefs loader;r=bgrins draft
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 08 Jun 2017 18:16:04 +0200
changeset 591080 ea167d45be864df68b39bdbf315655ad535780ce
parent 591079 a3e74ac27c9ce839f31288c048a8c2e6a4bb288c
child 592204 09b8e5ca4c9b8287b5bd90a47b7258045144717f
push id62947
push userjdescottes@mozilla.com
push dateThu, 08 Jun 2017 16:21:01 +0000
reviewersbgrins
bugs1371298
milestone55.0a1
Bug 1371298 - trim values extracted from pref files in devtools addon prefs loader;r=bgrins MozReview-Commit-ID: LuhOlYP4xYc
devtools/bootstrap.js
--- 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("'"))) {