搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Enterprise configuration: Customizing and locking about:config

  • 1 个回答
  • 1 人有此问题
  • 9 次查看
  • 最后回复者为 ethanm

more options

I'm working within an enterprise environment, where I'm required to have certain Firefox configuration settings, and make the users unable to change them. Following guides I've found on several different sites, I've created a local-defaults.js file in $APPDIR$/defaults/pref/ with the following content:

pref("general.config.obscure_value", 0); pref("general.config.filename", "mozilla.cfg");

I've also created the mozilla.cfg file in $APPDIR$/ with following content:

//Firefox Settings // try{

lockPref("browser.startup.homepage", "about:blank"); lockPref("browser.download.dir", "N:"); lockPref("browser.download.downloadDir", "N:"); lockPref("app.update.enabled", false); lockPref("extensions.update.enabled", false); lockPref("browser.shell.checkDefaultBrowser", false); lockPref("browser.search.update", false); lockPref("browser.formfill.enable", false); lockPref("signon.prefillForms", false); lockPref("dom.disable_open_during_load", true); lockPref("dom.disable_window_move_resize", true); lockPref("dom.event.contextmenu.enabled", false); lockPref("dom.disable_window_status_change", true); lockPref("dom.disable_window_flip", true); lockPref("dom.disable_window_open_feature.status", true); lockPref("security.warn_leaving_secure", true); lockPref("privacy.sanitize.promptOnSanitize", false); lockPref("privacy.sanitize.sanitizeOnShutdown", true); lockPref("security.default_personal_cert", "Ask Every Time"); lockPref("signon.rememberSignons", false); lockPref("xpinstall.whitelist.required", true); lockPref(“network.protocol-handler.external.shell”,false); lockPref(“security.enable_ssl3”,true); lockPref(“security.enable_ssl2”,false); lockPref(“security.enable_tls”,true); lockPref("plugin.disable_full_page_plugin_for_types", "application/pdf,application/doc,application/xls,application/bat,application/ppt,application/mdb,application/mde,application/fdf,application/xfdf,application/lsl,application/lso,appliation/lss,application/iqy,application/rqy,application/xlk,application/pot,application/pps,application/dot,application/wbk,application/ps,application/eps,application/wch,application/wcm,application/wbi,application/wb1,application/wb3,application/rtf,application/wch,application/wcm,application/ad,application/adp,application/xlt, application/dos, application/wks"); lockPref("privacy.item.history", false) lockPref(" } catch(e) {

 displayError("lockedPref", e);

}

That isn't all of the settings I have configured, but they all follow the same format - lockPref("setting", and then either a boolean or "string"); My problem is that Firefox is completely ignoring any settings places in the mozilla.cfg file. If the file isn't there, or is unreadable, Firefox refuses to start (unable to read config file). I've tried commenting out all but one of the settings (lockPref("browser.startup.homepage", "about:blank"), but I'm still not seeing the setting set or recorded in about:config. Both files are UTF-8 encoded. I've tried removing the try statement, as well as the second commented line, and commenting out individual config statements (and all but one config statement), but still no change in the browser.

Anyone know why my config changes are being ignored?

I'm working within an enterprise environment, where I'm required to have certain Firefox configuration settings, and make the users unable to change them. Following guides I've found on several different sites, I've created a local-defaults.js file in $APPDIR$/defaults/pref/ with the following content: pref("general.config.obscure_value", 0); pref("general.config.filename", "mozilla.cfg"); I've also created the mozilla.cfg file in $APPDIR$/ with following content: //Firefox Settings // try{ lockPref("browser.startup.homepage", "about:blank"); lockPref("browser.download.dir", "N:"); lockPref("browser.download.downloadDir", "N:"); lockPref("app.update.enabled", false); lockPref("extensions.update.enabled", false); lockPref("browser.shell.checkDefaultBrowser", false); lockPref("browser.search.update", false); lockPref("browser.formfill.enable", false); lockPref("signon.prefillForms", false); lockPref("dom.disable_open_during_load", true); lockPref("dom.disable_window_move_resize", true); lockPref("dom.event.contextmenu.enabled", false); lockPref("dom.disable_window_status_change", true); lockPref("dom.disable_window_flip", true); lockPref("dom.disable_window_open_feature.status", true); lockPref("security.warn_leaving_secure", true); lockPref("privacy.sanitize.promptOnSanitize", false); lockPref("privacy.sanitize.sanitizeOnShutdown", true); lockPref("security.default_personal_cert", "Ask Every Time"); lockPref("signon.rememberSignons", false); lockPref("xpinstall.whitelist.required", true); lockPref(“network.protocol-handler.external.shell”,false); lockPref(“security.enable_ssl3”,true); lockPref(“security.enable_ssl2”,false); lockPref(“security.enable_tls”,true); lockPref("plugin.disable_full_page_plugin_for_types", "application/pdf,application/doc,application/xls,application/bat,application/ppt,application/mdb,application/mde,application/fdf,application/xfdf,application/lsl,application/lso,appliation/lss,application/iqy,application/rqy,application/xlk,application/pot,application/pps,application/dot,application/wbk,application/ps,application/eps,application/wch,application/wcm,application/wbi,application/wb1,application/wb3,application/rtf,application/wch,application/wcm,application/ad,application/adp,application/xlt, application/dos, application/wks"); lockPref("privacy.item.history", false) lockPref(" } catch(e) { displayError("lockedPref", e); } That isn't all of the settings I have configured, but they all follow the same format - lockPref("setting", and then either a boolean or "string"); My problem is that Firefox is completely ignoring any settings places in the mozilla.cfg file. If the file isn't there, or is unreadable, Firefox refuses to start (unable to read config file). I've tried commenting out all but one of the settings (lockPref("browser.startup.homepage", "about:blank"), but I'm still not seeing the setting set or recorded in about:config. Both files are UTF-8 encoded. I've tried removing the try statement, as well as the second commented line, and commenting out individual config statements (and all but one config statement), but still no change in the browser. Anyone know why my config changes are being ignored?

由ethanm于修改

所有回复 (1)

more options

It appears that the [code]pref("general.config.obscure_value", 0);/code doesn't actually work, so I had to remove it from the .js file and ROT13 encode the mozilla.cfg I was using.