Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

how to change the the setting "Privacy & Security - History - Clear history when Firefox closes" using mozilla.cfg

  • 4 回覆
  • 1 有這個問題
  • 48 次檢視
  • 最近回覆由 cor-el

more options

My Firefox 70.0 32-bit version is default to not clear history when Firefox closes. However, when I upgrade to Firefox 68.2 ESR 64-bit, it is defaulted to clear history when Firefox closes. How do I toggle that value in .cfg file. I want to change the config before install Firefox because changing it after the installation is not feasible. I have a lot of users to install. Thanks.

My Firefox 70.0 32-bit version is default to not clear history when Firefox closes. However, when I upgrade to Firefox 68.2 ESR 64-bit, it is defaulted to clear history when Firefox closes. How do I toggle that value in .cfg file. I want to change the config before install Firefox because changing it after the installation is not feasible. I have a lot of users to install. Thanks.
附加的畫面擷圖

被選擇的解決方法

The main checkbox is set using the privacy.sanitize.sanitizeOnShutdown preference. The individual items to clear are toggled using the privacy.clearOnShutdown.* preferences. For example, the privacy.clearOnShutdown.cookies will toggle cookies on or off.

As an example, if you wanted to clear only the cache and cookies when Firefox is closed and lock it so that the user can't make changes, you would need the following code:

lockPref("privacy.sanitize.sanitizeOnShutdown", true);
lockPref("privacy.clearOnShutdown.cookies", true);
lockPref("privacy.clearOnShutdown.cache", true);
lockPref("privacy.clearOnShutdown.downloads", false);
lockPref("privacy.clearOnShutdown.history", false);
lockPref("privacy.clearOnShutdown.formData", false);
lockPref("privacy.clearOnShutdown.offlineApps", false);
lockPref("privacy.clearOnShutdown.sessions", false);
lockPref("privacy.clearOnShutdown.siteSettings", false);

Hope this helps.

從原來的回覆中察看解決方案 👍 2

所有回覆 (4)

more options

選擇的解決方法

The main checkbox is set using the privacy.sanitize.sanitizeOnShutdown preference. The individual items to clear are toggled using the privacy.clearOnShutdown.* preferences. For example, the privacy.clearOnShutdown.cookies will toggle cookies on or off.

As an example, if you wanted to clear only the cache and cookies when Firefox is closed and lock it so that the user can't make changes, you would need the following code:

lockPref("privacy.sanitize.sanitizeOnShutdown", true);
lockPref("privacy.clearOnShutdown.cookies", true);
lockPref("privacy.clearOnShutdown.cache", true);
lockPref("privacy.clearOnShutdown.downloads", false);
lockPref("privacy.clearOnShutdown.history", false);
lockPref("privacy.clearOnShutdown.formData", false);
lockPref("privacy.clearOnShutdown.offlineApps", false);
lockPref("privacy.clearOnShutdown.sessions", false);
lockPref("privacy.clearOnShutdown.siteSettings", false);

Hope this helps.

由 Wesley Branton 於 修改

more options

Thanks Wesley. I didn't realize the main checkbox using privacy.sanitize.sanitizeOnShutdown. Do you know where I can find all the settings for about:config?

more options

They change constantly, so there really isn't a complete list available. Some websites has attempted to keep a complete list, but all of them are outdated at this point.

I have proposed a document called Finding Firefox Preference Names that outlines the process I use, although it has not yet been reviewed by the Mozilla knowledge base team.

Basically, the way I find the preference names that I want is I open the Firefox profile folder on my computer and open the prefs.js file in there. That includes a list of all of the preferences set in Firefox. I copy the contents of the file into Notepad.

Then I make the change that I want in the Firefox settings and copy the new contents of the prefs.js file into another Notepad. Then I paste each file contents into an online text difference program to see what changed between the two configurations.

With the exception of the back-end Firefox Sync preferences, you will generally find that the preference you changed will be listed there. I'm not really sure if there is a better way to do it, but that's my method.

Other times, if I can't find the preference or if the preference doesn't get marked as changed in the prefs.js file for some reason, I will just search a keyword on the about:config page.

more options

Note that in this case you can easily find the name of the preference on the about:preferences page via the Web Console.