Join the Mozilla’s Test Days event from Dec 2–8 to test the new Firefox address bar on Firefox Beta 134 and get a chance to win Mozilla swag vouchers! 🎁

搜索 | 用户支持

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

详细了解

How to add customization logic around lockPref() when using it in .cfg file

  • 1 个回答
  • 1 人有此问题
  • 2 次查看
  • 最后回复者为 cor-el

more options

I wanted a way to apply the lockPref only when certain conditions are met and also add some customization logic around the lockPref functionality. How can I acheive this?. Any sample script to acheive this is greatly appreciated.

User Agent

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

I wanted a way to apply the lockPref only when certain conditions are met and also add some customization logic around the lockPref functionality. How can I acheive this?. Any sample script to acheive this is greatly appreciated. == User Agent == Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

被采纳的解决方案

mozilla.cfg is a JavaScript file, so you can try to add the instruction to that file to see if that works. What kind of customizationlogic do you have in mind?

if (condition) {

lockPref(prefName, prefValue);

}

定位到答案原位置 👍 0

所有回复 (1)

more options

选择的解决方案

mozilla.cfg is a JavaScript file, so you can try to add the instruction to that file to see if that works. What kind of customizationlogic do you have in mind?

if (condition) {

lockPref(prefName, prefValue);

}