Writing Extension Preferences UI for Firefox 1.1

Talk about add-ons and extension development.
miek
Posts: 33
Joined: December 5th, 2004, 2:05 pm
Contact:

great

Post by miek »

this is great.
makes my life easier.

what i want to know it when is this going to be available for thunderbird?
asqueella
Posts: 4019
Joined: November 16th, 2003, 3:05 am
Location: Russia, Moscow

Post by asqueella »

It is available in trunk TB builds already.
miek
Posts: 33
Joined: December 5th, 2004, 2:05 pm
Contact:

Post by miek »

sweeeeeeet
----
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050223 Firefox/1.0.1
----
All-in-one gestures | firesomething | Gmail notifier | ieview | image zoomer | tab scroller | stumble upon | cute menus | signature
----
mboullet
Posts: 337
Joined: November 5th, 2002, 2:34 am
Location: France
Contact:

Post by mboullet »

In AiO, I have a file with the following code:

Code: Select all

<?xml version="1.0"?>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script type="application/x-javascript"><![CDATA[
  document.getElementById("useAutoScrolling").setAttribute("disabled", "true");
]]></script>

</overlay>

It overlays chrome://browser/content/pref/pref-advanced.xul. The purpose is to grey out the autoscrolling pref in Firefox options since autoscrolling preferences must be set in AiO options.
Whether or not this is a good idea is not relevant here.

This doesn't work anymore in Deer Park due to the preferences UI rewrite. I tried 2 things:
1. Overlay chrome://browser/content/preferences/preferences.xul with the same code. I receive the JS error: document.getElementById("useAutoScrolling") has no properties, which may be normal because "useAutoScrolling" is defined in the "advanced prefpane".
2. I tried to overlay the "advanced prefpane" chrome://browser/content/preferences/advanced.xul, still with the same file: Boum!! Firefox crashes as soon I select Tools->Options...

Asqueella, Cusser, Ben ... you are much smarter than me on this topic. Any idea ??
Marc
User avatar
Mossop
Posts: 717
Joined: January 11th, 2004, 7:24 am
Location: Swansea, UK

Post by Mossop »

mboullet wrote:I tried to overlay the "advanced prefpane" chrome://browser/content/preferences/advanced.xul, still with the same file: Boum!! Firefox crashes as soon I select Tools->Options...

Asqueella, Cusser, Ben ... you are much smarter than me on this topic. Any idea ??


Bug 283949
asqueella
Posts: 4019
Joined: November 16th, 2003, 3:05 am
Location: Russia, Moscow

Post by asqueella »

I think you can lock that pref through prefs service, and it'll appear disabled in options UI.
doron
Posts: 935
Joined: November 4th, 2002, 4:50 pm

Post by doron »

Note that you should never try to overlay the existing, individual pref panels to add some new UI to the panel - it will crash.
If you see a marquee, clap your hands!
TheOneKEA
Posts: 4864
Joined: October 16th, 2003, 5:47 am
Location: Somewhere in London, riding the Underground

Post by TheOneKEA »

But you can overlay the main <prefwindow/> and replace the src attributes of existing <prefpane/>s - TBP does it to the Tabs pane of the current Options dialog.
Proud user of teh Fox of Fire
Registered Linux User #289618
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

has all of this stuff been posted on http://kb.mozillazine.org/Dev_:_Extensions ? If so, I'll add it to the FAQ
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
asqueella
Posts: 4019
Joined: November 16th, 2003, 3:05 am
Location: Russia, Moscow

Post by asqueella »

Although there is a doc with reference information on kb.mozillazine.org (linked from the first post), the plan was to post it to developer.mozilla.org eventually. I don't think this will need a link of its own in the FAQ thread. I also think this thread can be unstickied (if Cusser agrees).
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

If it's in the KB and may eventually go into DevMo, then this thread is basically obsolete. I'll ask for it to be unstickied.
HeroreV
Posts: 30
Joined: June 23rd, 2004, 8:03 pm

Post by HeroreV »

The onpreferenceread and onpreferencewrite attributes have been renamed to onsyncfrompreference and onsynctopreference. (you can read about it at Preferences System:New attributes)

I was quite confused for a while as to why my script was suddenly being completely ignored. Is there a comprehensive list of changes somewhere between Deer Park Alpha 1 and 2?
asqueella
Posts: 4019
Joined: November 16th, 2003, 3:05 am
Location: Russia, Moscow

Post by asqueella »

Use bonsai if you need a comprehensive list. You can also search 'fixed' bugzilla bugs in the component you're interested in.
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

Post Reply