阅读自定义Firefox的about:config [英] Reading custom firefox about:config

查看:133
本文介绍了阅读自定义Firefox的about:config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在firefox的about:config上创建新的值并通过JavaScript等编程语言读取它们?

$ myBranchOfPrefs.setIntPref('somenumber',456);

必须使用setBoolPref或setStringPref,具体取决于你想要的值

这是非常基本的,通常你不会像这样使用它,你会设置一个偏好监听器,所以每当你修改了你的插件时,都要使用这个值来更新你的插件。

How can I create new values on about:config of firefox and read them by programming language such as JavaScript?

解决方案

var myBranchOfPrefs = Services.prefs.getBranch('extensions.myaddon.');

myBranchOfPrefs.setIntPref('somenumber', 456);

have to use setBoolPref or setStringPref depending on what you want value to be

this is very basic, usually you wont use it like this, youll set up a preference listener, so whenever its modified you update your addon with that value

这篇关于阅读自定义Firefox的about:config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆