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?"
There's an OReilly book, if that helps.
You can always start at mozilla and xulplanet
mozilla
xulplanet
As for the more advanced stuff, I'm not sure where.
This is slashdot after all, probably the best place to ask for this: Someone should make a "non-logged" (read: pr0n) browsing mode extension for firefox. :)
Creating a revertable point in history, cookies, and other saved information would be better than just turning off all additions to those.
Clearing history, cache and the likes afterwards is a nuisance and loses all information on visits to other sites.
It's targeted for Firefox extensions, but should serve your purpose pretty well.
It's fairly good, and available for free in PDF. http://phptr.com/promotion/1484?redir=1
Try XulPlanet, it's the only resource on XUL that is actually working, for me at least. In my company, we're regularly delivering apps with XUL as a frontend and all developers use XulPlanet.
On the down side, welcome to the land of magic and wonder, where arcane bugs haunt the long forgotten planes of DOM...
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.
Nothing a quick google-search wouldn't pick up. But that hasn't stopped ask /. in the past, I guess.
This sig is intentionally left blank
If you're just starting out with XUl, you may want to brish up on your JavaScript first. Although XUL itself is a rather straightforward markup language (albeit with many, many quirks), in order to make your app actually do anything, you'll need to write some JavaScript to control it. There are many, many Javascript resources out there, and I also recommend JavaScript: The Definitive Guide from O'Reilly.
u l), though not too many people use those groups anymore.
Once you have that down, here are a few XUL sites I recommend:
Creating Application with Mozilla - Online version of O'Reilly's book. Great resource for beginners to follow through, but some of the examples no longer work due to changes in the APIs since the books release.
XUL Planet - An excellene resource for XUL developers of any level. This site contains a great tutorial for getting started and becoming familiar with the environment, as well as a definitive reference guide for XUL and XPCOM objects and functions.
XUL Planet Forum - This forum is also housed at the XUL Planet website, but it deserves separate mention. This is the only forum/newsgroup/list I've been able to find that's still active and populated with friendly and helpful souls. I've received helped there several times on problems I'd been working on for weeks or months.
There are also a few XUL-related newsgroups on mozilla's usenet server (eg, news://news.mozilla.org:563/netscape.public.dev.x
There's also Mozilla official XUL Programmer's Reference. This is a great reference resource, but it's not geared for beginners.
And finally, the mother of all example sites: http://www.hevanet.com/acorbin/xul/top.xul If you can't figure out how something work, this most likely has a working example.
Good luck!
Try Rapid Application Development with Mozilla by Nigel McFarlane, published by Prentice Hall.
It goes pretty in depth and covers a lot of ground about a lot of the parts of XUL: XBL, XPCOM, XML, etc.
I would recommend it highly.
Probably not since Slashdot is primarily a Fantasy Film and Gamer site. You should probably seek out a forum that deals with science on a more regular basis.
"Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
For Javascript I have that O'reily's The definitive Guide on Javascript to be exeptional. I mostly use it today for referencing specfic methods and functions, but it's also a good book to start with.
With XUL nearly all of the dynamic aspects are controlled by javascript, so its good to get a good grounding in that subject before you start in with the XUL tags.
I recently coded an XUL tree that loads links at the click event. Sounds easy but it took me a long time to figure out how to bubble up the right event.
The only way I figured it out was with the help of that javascript book.
Go Gusties
When will we be able to write XUL apps in PHP, like can be done with Perl, Python, and Ruby?
propietary web browser language
need i say more?
back in the day we didnt have no old school
You will want Ted's Extension Developer extension if you're going to develop Mozilla (including Firefox/Thunderbird) extensions. Incredibly useful.
Best source on mozilla development:
s /0 131423436_pdf.zip
http://www.informit.com/content/downloads/peren
Laszlo
http://www.openlaszlo.org/
I was wondering when someone was going to mention this. Two things. One XUL and SWF could be combined for a richer experience. Two there's nothing to the possability to modifying the server so that it presents a higher-level model to javascript, and XUL, spitting out XUL, Javascript, and anything else plugins allow. e.g PDFs.
...Curl as well.
Don't forget there's
"ANY browser technology that segregates netizens based on applications for a piece of market share really removes themselves from what the net and 'cyberspace' mean, at least to me."
Then you're going to hate XAML then.
I can't believe noone has said this:
use the source, luke!
(links blatantly stolen from the mozilla amazon link page)
But seriously, disassemble other peoples code is the best way to learn. See how they do thing. Javascript is easy enough to understand and there are millions of tutorials on the subject alone, but if you want to see how it interacts with XUL applications this is your best bet. And hey, all those applications are zero install and can run in the browser, how cool isn't that!? =P
For example, the most difficult thing for me was trying to figure out how to package up my XUL/JS in a form that Firefox would take it. All the tutorials talked about install.js, installed-chrome.txt, and regxpcom, all of which are outdated. (Hint: Since Firefox 0.9, install.rdf is the key to the whole thing, so any tutorial that doesn't mention it is outdated.)
Once you've gotten the basics (probably by reading the O'Reilly book--the Nigel MacFarlane book may have a lot of useful info, but it was so poorly written I couldn't get through it), you really want to do yourself a favor and install Venkman, the Javascript debugger. The only place I've been able to find that has this little gem for Firefox is here.
Then, as you inevitably run into walls trying to get things done in the browser, cozy up to the source. There's not much you can do with XUL/JS that hasn't already been done in the Firefox source, and the search tools available on LXR will often lead you right to them.
And here are some source files you're definitely going to need to look at:
browser main window
browser menus and commands
browser main logic
Also, shamelessly unzip and dissect other people's XPI's; they probably won't mind anyway.
There used to be a language specification on the netscape.com site, but where is it now? You should also read some things on Javascript and prototyping.
http://piro.sakura.ne.jp/xul/xul.html#tipse transrate from Japanese to English...
Pleas
First you must understand how components work in mozilla. I read the book "Creating XPCOM Components" from the mozilla site. I found it a great resource. It explains the mozilla architecture, how to create extensions, install and deploy them, and interact with other components in mozilla. I think it is a great starting point. You must have some C++ knowledge to understand it.
Honestly, documentation is the dark horse of Mozilla development (I know, because I have on-again, off-again pushes to write docs for mozilla.org and friends).
http://books.mozdev.org has the online version of "Creating Applications With Mozilla" from the O'Reilly crew.
Last, but not least, if you have a really simple question that hasn't been answered by one of the above resources, consider searching Bugzilla for bugs that are unfixed and bugs which have been marked fixed or invalid. You can learn a lot that way.
Alex Vincent
http://weblogs.mozillazine.org/weirdal
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.
Construye tu propia extensión para Firefox
If anyone happens to read this and is interested, I've created a sourceforge project for it.