Closed Bug 784806 Opened 9 years ago Closed 7 years ago

Add most "browser.download" prefs to about:support

Categories

(Toolkit :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- fixed

People

(Reporter: cilias, Assigned: avp, Mentored)

Details

(Whiteboard: [good first bug][lang=js])

Attachments

(1 file, 1 obsolete file)

about:support should include browser.download prefs.

There are at least a couple prefs that I assume should not be there for privacy reasons, like browser.download.dir and browser.download.lastDir, but most should be included.
Hardware: ARM → All
Whiteboard: [good first bug]
Mentor: adw
Whiteboard: [good first bug] → [good first bug][lang=js]
Hi Drew,

I am interested in working on this bug. Can you please help me get started? Which files should I look into?

Thanks.
Hi Abhishek, sure, thanks for volunteering!  Have you gotten the Firefox source and tried building it?  First you'll need to do that, and these pages explain how:

https://developer.mozilla.org/en-US/docs/Introduction
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide

Then you can fix this bug, which should be easy.  All you have to do is add the following strings to the PREFS_WHITELIST array here: http://mxr.mozilla.org/mozilla-central/source/toolkit/modules/Troubleshoot.jsm?rev=03510eff818b#25  Please add them so that PREFS_WHITELIST remains in alphabetical order.

browser.download.folderList
browser.download.hide_plugins_without_extensions
browser.download.importedFromSqlite
browser.download.lastDir.savePerSite
browser.download.manager.addToRecentDocs
browser.download.manager.alertOnEXEOpen
browser.download.manager.closeWhenDone
browser.download.manager.displayedHistoryDays
browser.download.manager.quitBehavior
browser.download.manager.resumeOnWakeDelay
browser.download.manager.retention
browser.download.manager.scanWhenDone
browser.download.manager.showAlertOnComplete
browser.download.manager.showWhenStarting
browser.download.preferred.*
browser.download.useDownloadDir

Once you've done that and rebuilt Firefox, you should be able to change any of these preferences in about:config and then open about:support and see the preference listed.

Let me know here in the bug when you have questions.  You can also join #fx-team on IRC to talk to me and other Firefox developers.  I'm adw there.  https://wiki.mozilla.org/IRC
For posterity, I chose the above preferences by searching mxr for all browser.download strings.  I came up with this list:

browser.download.animateNotifications
browser.download.debug
- browser.download.defaultFolder
- browser.download.dir
- browser.download.downloadDir
? browser.download.folderList
? browser.download.hide_plugins_without_extensions
? browser.download.importedFromSqlite
- browser.download.lastDir
? browser.download.lastDir.savePerSite
? browser.download.manager.addToRecentDocs
? browser.download.manager.alertOnEXEOpen
? browser.download.manager.closeWhenDone
? browser.download.manager.displayedHistoryDays
browser.download.manager.flashCount
browser.download.manager.focusWhenStarting
browser.download.manager.openDelay
? browser.download.manager.quitBehavior
? browser.download.manager.resumeOnWakeDelay
? browser.download.manager.retention
? browser.download.manager.scanWhenDone
browser.download.manager.showAlertInterval
? browser.download.manager.showAlertOnComplete
? browser.download.manager.showWhenStarting
browser.download.panel.shown
? browser.download.preferred.*
browser.download.saveLinkAsFilenameTimeout
browser.download.show_plugins_in_list
? browser.download.useDownloadDir
browser.download.useJSTransfer
browser.download.useToolkitUI

A minus (-) means that pref should not be listed in order to protect the user's privacy.  A question mark (?) means I thought the pref might be useful to troubleshooters.  I checked each pref on mxr to see how it's used, and to be honest I'm not sure about a lot of the question marked prefs.  I'm not even sure whether some of them are used anymore.  But I erred on the side of showing them, figuring that it couldn't hurt.

And I chose to specifically name whitelisted prefs, as opposed to simply whitelisting "browser.download." and then blacklisting the minus'ed prefs, so that if we add a new download pref in the future that should be blacklisted but we forget to do it, it won't appear.
I built firefox with the patch applied and ran, but could not find those prefs in about:config.
Attachment #8559628 - Flags: feedback?(adw)
Comment on attachment 8559628 [details] [diff] [review]
Added browser.download prefs to PREFS_WHITELIST

Review of attachment 8559628 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!  I actually am able to see those preferences in about:config, but only after I modify them.  Are you sure you did that?  What I mean is, you need to open about:config and paste any one of those preferences into the search box at the top.  If the pref already exists, then it will be listed; if it doesn't exist, then the search won't find anything.  If the pref already exists, then you need to make sure it's bold, which means it's modified.  If it's not bold, double-click it and then change the value.  If the pref does not exist, then you can right-click, choose New, and then the type of the pref.  For example, browser.download.lastDir.savePerSite is a boolean, so choose Boolean, and then choose True as the value.  Then open about:support or refresh it if it's already open, and you should see the new pref.

Of course you need to make sure you rebuild Firefox first after you change the code.  In this case, running `./mach build toolkit/modules` should be enough to rebuild it.

::: toolkit/modules/Troubleshoot.jsm
@@ +43,5 @@
> +  "browser.download.manager.retention",
> +  "browser.download.manager.scanWhenDone",
> +  "browser.download.manager.showAlertOnComplete",
> +  "browser.download.manager.showWhenStarting",
> +  "browser.download.preferred.*",

Oops, my mistake, but this should not have an asterisk (*) on the end.  This string should end in a dot, like this:

  "browser.download.preferred.",

Could you please change that and attach the new patch?  Or if you prefer, I could do that myself.  Let me know.
Attachment #8559628 - Flags: feedback?(adw) → feedback+
(In reply to Drew Willcoxon :adw from comment #5)
> Thanks!  I actually am able to see those preferences in about:config

I meant in about:support.
Assignee: nobody → abhishekp.bugzilla
Attachment #8559628 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8559971 - Flags: review?(adw)
Comment on attachment 8559971 [details] [diff] [review]
Added browser.download prefs to PREFS_WHITELIST

Review of attachment 8559971 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great, thanks!  I'll land this later today.
Attachment #8559971 - Flags: review?(adw) → review+
https://hg.mozilla.org/mozilla-central/rev/14abbfddd5c2
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.