Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

xulrunner preferences

282 views
Skip to first unread message

janekw

unread,
Jun 1, 2006, 6:32:26 AM6/1/06
to
Hello,

I can't really understand how xulrunner preferences work.
I have simple xulrunner application:

/testapp
--/chrome
----/testapp
------start.html
----chrome.manifest
--/defaults
----/preferences
------prefs.js
--application.ini

My first entry in prefs.js is:
pref("toolkit.defaultChromeURI",
"chrome://testapp/content/start.html");

When I run the app, I see a xulrunner window with my start.html inside.
So far so good.
I've played a little with my preferences, then. I had those warnings
messages when I tried to use external protocol handlers. So I add:

pref("network.protocol-handler.warn-external.mailto", false);
pref("network.protocol-handler.warn-external.http", false);

...to my prefs.js. It definitely worked. Then I wanted to start my
window maximized. Just for a start I added this snippet I found
somewhere:

pref("toolkit.defaultChromeFeatures", "chrome,resizable=no,dialog=no");

This definitely didn't work. I've tried also a few other printer
settings (like "pref("print.print_headercenter", "whatever");");
without any success.

Then I've noticed all.js file in xulrunner/greprefs subfolder. I've
played with my favourite setting
"network.protocol-handler.warn-external.http" - works. But I've also
noticed settings like "browser.anchor_color" or
"browser.underline_anchors" which, though set, don't affect my app at
all (i.e. links are white and not underscored).

So how come some settings works, and some don't affect anything? Alike
in my settings file and global settings (I guess)?

Thanks,
Jan

James Ross

unread,
Jun 1, 2006, 7:07:07 AM6/1/06
to
janekw wrote:
> Then I've noticed all.js file in xulrunner/greprefs subfolder. I've
> played with my favourite setting
> "network.protocol-handler.warn-external.http" - works. But I've also
> noticed settings like "browser.anchor_color" or
> "browser.underline_anchors" which, though set, don't affect my app at
> all (i.e. links are white and not underscored).

I don't know about the other stuff, but the link preferences will not
affect your HTML file because it is loaded as chrome - those preferences
only apply to content.

--
James Ross <sil...@warwickcompsoc.co.uk>
ChatZilla Developer

janekw

unread,
Jun 1, 2006, 8:18:43 AM6/1/06
to
James Ross wrote:

> I don't know about the other stuff, but the link preferences will not
> affect your HTML file because it is loaded as chrome - those preferences
> only apply to content.

...so. How to load html as a content?:) Perhaps those "maximized
window" preferences will work then, too.

I can live without link's colors and underlining, I can css-style them
or whatever. But I am really concerned with printer settings (I want to
be able to print without headers or footers) and window settings
(maximize / fulscreen).

Jan

janekw

unread,
Jun 2, 2006, 7:08:35 AM6/2/06
to
I'm now able to display preferences form javascript in my start.html
using "@mozilla.org/preferences-service;1" component.
"print.print_footerleft" setting and other printer settings display
corrent info - i.e. what I've provided in my prefs.js (or all.js in
xulrunner for that matter). Nonetheless, all of this doesn't affect the
"real" printing.
How can it be? Where else should I put this settings?

Jan

James Ross

unread,
Jun 2, 2006, 10:19:36 AM6/2/06
to
janekw wrote:
> James Ross wrote:
>
>> I don't know about the other stuff, but the link preferences will not
>> affect your HTML file because it is loaded as chrome - those preferences
>> only apply to content.
>
> ....so. How to load html as a content?:) Perhaps those "maximized

> window" preferences will work then, too.

Load an XUL file with <browser type="content"> (or <iframe
type="content">) in, then load your HTML in it. I wouldn't bother,
though, and instead just style the links yourself.

Can't help with the printing problem, though.

janekw

unread,
Jun 5, 2006, 6:39:29 AM6/5/06
to
I've finally managed to understand how the preferences system in
xulrunner works. For those who may come across the same problem: a
setting in yourapp/defaults/preferences/prefs.js will work unless there
is the same setting in prefs.js in your app's profile folder (which is
created by xulrunner on the first app's run).
Now it's obvious, really.

Jan

0 new messages