Bug 1371298 - trim values extracted from pref files in devtools addon prefs loader;r=bgrins
authorJulian Descottes <jdescottes@mozilla.com>
Thu, 08 Jun 2017 18:16:04 +0200
changeset 411165 a494916f461a29dac8099841efa3eb6024d99796
parent 411164 b418659052d26c36c9e4f0f569d5277a5643086f
child 411166 0dac00039fda22f1570a0e439b34703b6f5e5fa6
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1371298
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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("'"))) {