Slashdot Mirror


A Good Resource for Learning XUL & Javascript?

RJabelman asks: "I'm trying to write a Mozilla extension, but I can't find a decent resource to learn from. Tutorials abound for packaging up an extension, and the web's littered with Javascript snippets to pretty up a web page, but there seems to be very little authoritative information for doing serious work with Javascript, XUL and Mozilla (and more specifically, manipulating XML). I can find my one true resource for every other language or API I've learned: but not this. Can anyone point me to theirs?"

5 of 82 comments (clear)

  1. Dynamic menus by Earlybird · · Score: 4, Interesting
    The XUL/Mozilla/Firefox documentation is scattered all over the place. You survive on bits and pieces, little tutorials someone cooked up on their own time, the Mozilla reference, existing extensions, etc. Documentation is often written for the old Mozilla suite, and thus out of date with respect to, say, Firefox' new extension-loading conventions.

    What I want to know, which nobody seems to document, is how to create menus dynamically in Firefox. Instead of specifying the menus statically in XML, I want to create them at runtime -- specifically, I want to create a top-level menu item and populate its submenu at runtime based on HTTP queries or something similar. I know it's possible, but I have not figured out how.

  2. Javascript is nice, but by Dracos · · Score: 2, Interesting

    When will we be able to write XUL apps in PHP, like can be done with Perl, Python, and Ruby?

    1. Re:Javascript is nice, but by rycamor · · Score: 2, Interesting

      Don't underestimate Javascript. In some ways, Javascript is actually a more elegant and well-thought-out language than PHP. See Crockford's rant.

      Many *implementations* of Javascript are lacking, but Mozilla applications turn Javascript into a full-featured scripting language, including the ability to use sockets, read/write files, run other executables, and in general do just about everything you would need to do for a XUL "front end" application. For more serious back-end integration, just use sockets to talk to other processes, which can be written in PHP, C, Python, whatever.

  3. Go for... by sabit666 · · Score: 2, Interesting

    Laszlo
    http://www.openlaszlo.org/

  4. Documentation the next challenge for Mozilla by Anonymous Coward · · Score: 1, Interesting

    Right now the platform documentation hasn't been compiled into a form that's accessible for external (to the Mozilla project) developers.

    Now Firefox 1.0 is out, and the Mozilla / XUL runtime is speading, hopefully we'll see the Mozilla team setting up something approaching PHP's documentation (which is a big part of PHP's success as a technology for the masses). Part of that is having a supporting documentation team, willing to keep it complete and up-to-date. Spreadfirefox.com shows it's possible for Mozilla to develop that kind of community.

    The other challenge is making "remote XUL" (launched from a website) a reality. Right now it equates almost to a different technology to "local XUL" such as that used in a Firefox extension, thanks to a very restrictive (and poorly documented) security model. Mozilla, so far, have opted for the script-signing approach - that fact that Amazon did not sign their A9 Firefox extension says it all...

    Anyway - a good place to trawl for links is http://del.icio.us/tag/xul - otherwise it's a matter of learning XUL like you learnt HTML years ago.