设置 xulrunner 浏览器首选项

发布于 2024-10-08 15:44:56 字数 1802 浏览 0 评论 0原文

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

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

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

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

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

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

pref("浏览器.首选项.instantApply", false);

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

我还将添加我的 xul 文件 - 对帖子的长度表示歉意:

<?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>

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

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.

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.

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.use_document_colors", false);

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

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

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一杯敬自由 2024-10-15 15:44:56

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

defaults/prefs/xulrunner.js

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

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

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

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

defaults/prefs/xulrunner.js

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

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

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

孤者何惧 2024-10-15 15:44:56

我认为这可能是 xulrunner 中的一个错误。
如果我将 xulrunner 设置为打开 http://www.google.com 并打开 about:config 面板并设置< br>
browser.display.background_color 和
browser.display.use_document_colors
我看到网页没有任何变化。

用 Firefox 做同样的事情会产生预期的结果。
我已输入错误报告并将发布任何反馈。

I think this may be a bug in xulrunner.
If I set xulrunner to open http://www.google.com and open the about:config panel and set
browser.display.background_color and
browser.display.use_document_colors
I see no change in the web page.

Doing the same thing with Firefox yeilds the expected results.
I have entered a bug report and will post any feedback.

丶视觉 2024-10-15 15:44:56

由于 Firefox 也使用 Xulrunner,所以我猜如果 Firefox 确实存在此错误,那么该错误也会出现在 Firefox 中。您使用的是相同版本的 firfox 和 xulrunner 吗?

根据此页面,您需要将 browser.display.use_system_colors 设置为 false 以便背景颜色有影响。也许这就是为什么它在 xulrunner 中没有改变的原因。

考虑到您的代码,我不明白为什么它不起作用,但“bgcolour”和“preference”之间没有空格,也许这可能是一个错误。

Since firefox is using Xulrunner too, I guess the bug would be present in Firefox too if it were one. Are you using the same version of firfox and xulrunner?

According to this page you need to set browser.display.use_system_colors to false so that the background color have an effect. Maybe that's why it did not change in xulrunner.

Considering your code I don't see why it does not work but there is no space between "bgcolour" and "preference" maybe that could be an error.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文