Firefox

在 Mozilla 中鎖定首選項

  • October 29, 2018

出於安全原因,我們需要“鎖定”Mozilla Firefox 中的一些首選項。我們正在執行 Windows XP 和最新版本的 Mozilla 版本 14.0.1。特別是一些安全首選項,例如Security.ask_for_password. 如果使用者要這樣做about:config,我們希望特定選項顯示為灰色,以便他們無法點擊它們。

我已經讀到這可以通過添加以下內容來完成:

\Mozilla Firefox\defaults\pref\test.js

preflock("security.enable_ssl3", false);

但是,這無濟於事。

您的文件應該以 double 開頭//,我認為正確的術語是lockPref. 文件的正確內容應該是;

//
lockPref("security.enable_ssl3", false);

此外,您應該將此文件保存在安裝目錄的根目錄中並修改 local-settings.js 以載入該文件。

pref("general.config.filename", "test.js");

Firefox 63 和 Windows 10 的最新首選項鎖定…

Mozilla Firefox 63.00 版鎖定文件設置

  1. 打開 Firefox 並在路徑欄中輸入“about:config”。

一種。對於任何已鎖定的首選項,您將看到斜體條目和顯示“已鎖定”的狀態 2. 將以下內容創建為文本文件並更改每個文件的副檔名。

一種。mozilla.cfg – 列出需要鎖定的文件。

 i.    The first line is always a double forward slash (//)
ii.    Starting at the second line, use the lockPref command – examples:
   1.  lockPref("app.update.enabled", false);
   2.  lockPref("security.tls.version.min", 2);

灣。local-settings.js – 使用 mozilla.cfg 鎖定首選項。

i. Add the following entries. Do NOT place a “//” on the first line of the file.
   1.  pref("general.config.filename", "mozilla.cfg");
   2.  pref("general.config.obscure_value", 0);

C。user.js – 更改每個列出的首選項的設置。

i. Enter the same entries that were in mozilla.cfg but use the “user_pref” 
   command at the beginning of each entry. Do NOT place a “//” on the first line 
   of the file.
   1.  user_pref("app.update.enabled", false);
   2.  user_pref("security.tls.version.min", 2);
  1. mozilla.cfg 和 local-settings.js 文件所在的文件夾分配有完整的管理員和系統權限,但是要對這些文件進行更改,請將它們複製到另一個文件夾(即桌面),然後將其複制回各自的文件夾。UAC 提示要求接受更改。普通使用者不應該有這樣做的權利。
  2. 位置對於上述每個文件都非常重要。將每個放在各自的目錄中,如下所示。

一種。mozilla.cfg 被放入:

i.  C:\Program Files\Mozilla Firefox

灣。Local-settings.js 放入:

i.  C:\Program Files\Mozilla Firefox\defaults\pref

C。User.js 放入:

i.  C:\Users\”username”\AppData\Roaming\Mozilla\Firefox\Profiles\*this folder 
   name will vary for each installation*
  1. 要禁用 mozilla.cfg 中列出的文件,請打開 local-setting.js 文件並在每行的開頭添加“//”以將它們標記出來,保存然後重新啟動 Firefox。在 Firefox 中的“about:config”下驗證“鎖定”狀態是否已刪除。當然,要再次鎖定它們,請刪除“//”。

引用自:https://serverfault.com/questions/416337