设置 xulrunner 浏览器首选项 [英] setting xulrunner browser preferences

查看:50
本文介绍了设置 xulrunner 浏览器首选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我正在创建的应用程序使用 xulrunner-1.9.2.12.en-US.win32.我希望用户能够使用类似于 Firefox 中工具、选项、内容、颜色"菜单的内容来更改应用程序的颜色.

I am using a xulrunner-1.9.2.12.en-US.win32 for an app I am creating. I want the user to be able to change the colours of the app using something similar to the "tools, options, content, colors" menu in firefox.

我正在使用 prefwindow 使用颜色选择器设置 browser.display.background_color.如果我查看 chrome://global/content/config.xul,我会看到此属性的值已正确更改,但是,我看不到网页外观的相应更改.如果我在 Firefox 中查看此网页并通过工具、选项等进行相同的更改,页面会按预期更改.

I am using a prefwindow to set browser.display.background_color using a colour picker. If I look at chrome://global/content/config.xul I see that the value for this property has been correctly changed, however, I see no corresponding change in the web page look and feel. If I view this web page in firefox and make the same changes through tools, options etc, the page changes as expected.

我将我的 prefs.js 文件更改为以下内容作为测试,但没有结果:pref("browser.display.foreground_color", "#000000");

I changed my prefs.js file to the following as a test, with no result: pref("browser.display.foreground_color", "#000000");

pref("browser.display.background_color", "#FF0000");

pref("browser.display.background_color", "#FF0000");

pref("browser.display.use_document_colors", false);

pref("browser.display.use_document_colors", false);

pref("browser.display.use_system_colors", false);

pref("browser.display.use_system_colors", false);

pref("browser.preferences.instantApply", false);

pref("browser.preferences.instantApply", false);

pref("browser.preferences.animateFadeIn", false);

pref("browser.preferences.animateFadeIn", false);

我还将添加我的 xul 文件 - 适用于帖子长度:

I will also add my xul file - appologies for the length of the post:

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<prefwindow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<prefpane id="colorOptions" label="Colours">
<preferences>
<preference id="browser.display.foreground_color" name="browser.display.foreground_color" type="string"/>
<preference id="browser.display.background_color" name="browser.display.background_color" type="string"/>
</preferences>
<groupbox flex="1">
<caption label="Colour preferences"/>
<label value="Background colour" control="bgColour"/>
<colorpicker type="button" id="bgColour"preference="browser.display.background_color"/>
<label value="Foreground colour" control="fgColour"/>
<colorpicker type="button" id="fgColour" preference="browser.display.foreground_color"/>
<label value="Random colour" control="col"/>
<colorpicker type="button" id="col"/>
</groupbox>
</prefpane>
</prefwindow>

有什么想法吗?提前致谢,蚂蚁

Any ideas? Thanks in advanced, Ant

推荐答案

在我使用 xulrunner 1.9.0.3082 的应用程序中,我不得不更改文件

In my application using xulrunner 1.9.0.3082 I had to change the file

defaults/prefs/xulrunner.js

defaults/prefs/xulrunner.js

通过以下附加行,所有文本都以漂亮的蓝色显示:

With the following additional line all texts are shown in a beautiful blue:

pref("browser.display.foreground_color", "#00A4FA");

对文件 pref.js 的任何更改都不成功!

Any changes to the file pref.js were not successful!

这篇关于设置 xulrunner 浏览器首选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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