Bug 557738 - Add user.js section to about:support. r=adw

This commit is contained in:
Matthew Noorenberghe
2012-09-26 16:03:00 -07:00
parent e3f1196325
commit 39c260834e
5 changed files with 36 additions and 0 deletions

View File

@@ -366,4 +366,12 @@ let dataProviders = {
}
done(data);
},
userJS: function userJS(done) {
let userJSFile = Services.dirsvc.get("PrefD", Ci.nsIFile);
userJSFile.append("user.js");
done({
exists: userJSFile.exists() && userJSFile.fileSize > 0,
});
},
};

View File

@@ -178,6 +178,15 @@ let snapshotFormatters = {
);
$.append($("libversions-tbody"), trs);
},
userJS: function userJS(data) {
if (!data.exists)
return;
let userJSFile = Services.dirsvc.get("PrefD", Ci.nsIFile);
userJSFile.append("user.js");
$("prefs-user-js-link").href = Services.io.newFileURI(userJSFile).spec;
$("prefs-user-js-section").style.display = "";
},
};
let $ = document.getElementById.bind(document);

View File

@@ -209,6 +209,11 @@
</tbody>
</table>
<section id="prefs-user-js-section" style="display:none">
<h3>&aboutSupport.userJSTitle;</h3>
<p>&aboutSupport.userJSDescription;</p>
</section>
<!-- - - - - - - - - - - - - - - - - - - - - -->
<h2 class="major-section">
&aboutSupport.graphicsTitle;

View File

@@ -322,6 +322,16 @@ const SNAPSHOT_SCHEMA = {
},
},
},
userJS: {
required: true,
type: "object",
properties: {
exists: {
required: true,
type: "boolean",
},
},
},
},
};

View File

@@ -46,6 +46,10 @@ variant of aboutSupport.showDir.label. -->
<!ENTITY aboutSupport.modifiedPrefsName "Name">
<!ENTITY aboutSupport.modifiedPrefsValue "Value">
<!-- LOCALIZATION NOTE (aboutSupport.userJSTitle, aboutSupport.userJSDescription): user.js is the name of the preference override file being checked. -->
<!ENTITY aboutSupport.userJSTitle "user.js Preferences">
<!ENTITY aboutSupport.userJSDescription "Your profile folder contains a <a id='prefs-user-js-link'>user.js file</a>, which includes preferences that were not created by &brandShortName;.">
<!ENTITY aboutSupport.graphicsTitle "Graphics">
<!ENTITY aboutSupport.jsTitle "JavaScript">