XUL Based Web Applications. Why Not?
I have just done some support for remote XUL applications in ItsNat (not public yet). Maybe you do not know XUL - XUL is the web component system based on web technologies included in Gecko based browsers (for instance FireFox). It is not new, as the first release of Mozilla (v1.0) almost 10 years ago, included this technology. The chrome of FireFox uses XUL, that is, menus, buttons, toolbars, dialogs and so on. In some way XUL is similar to the component system based on tags of JSF or ZK (in fact ZK is strongly inspired in XUL). The difference is those tags are directly understood by FireFox, there is no translation to HTML. Using JavaScript, CSS and W3C DOM Events you can fully customize XUL native components in the clients, furthermore, XUL supports XHTML code and/or SVG code embedded. You can find two online examples using XUL here and here.
XUL support in ItsNat is easy because the approach “The Browser Is The Server” fits very well with management in server of any namespace natively supported by the browser, in fact, ItsNat already supports pure SVG pages.
XUL would allow development of remote (client/server) web applications that are very similar to desktop applications. Using XUL components could be added/removed/updated from server and sending client events to the server using AJAX (if some listener was registered) with no reload following the Single Page Interface pattern (in fact XUL was not designed for page based applications).
The “free” components of ItsNat can work with no problem with XUL markup, as it does with SVG. The problem arises around interactive XUL components like checkboxes or listboxes, components similar to the HTML counterparts (input checkbox select). In these kind of elements we can use the low level event system of ItsNat to synchronize the server DOM when the control changes in client. Nevertheless, custom components would be interesting providing data models, selection listeners etc, much like in HTML. The se new components are not done, this make me think is there enough demand?
As said before, XUL is not new. To add some example to the manual I have been searching XUL code and applications based on XUL, and the findings have been very disappointing. Most of the examples, tutorials, and articles are very old. Is XUL interesting and popular enough to spend any resources on it? Will be someday? Are there XUL applications beyond the FireFox chrome and fancy add-ons?
Why is not XUL popular? I have found some answers:
1) It is a technology only working in a single family of browsers (Gecko).
2) In spite of the fact that it can work remotely (XUL code served by web servers), the main purpose is to provide the desktop experience to the user. The focus is not page navigation, in fact XUL does not have a form tag (the HTML form can be used).
3) Web frameworks have largely ignored XUL. You can find some basic support in action frameworks and template technology allowing free design. I can't find (I haven’t) a server centric framework with support of XUL and AJAX.
Item 1 does not have a clean solution, in ItsNat automatic HTML and JavaScript generation would be the path to follow in browsers with no XUL support, however this is not an easy task, because the same behaviour is expected in FireFox (native XUL) and non-XUL browsers and because client events in HTML markup must be converted to DOM events received by the correct XUL element in server including simulation of bubbling and capturing.
Item 2 is not longer a problem because current trend is to avoid so much as possible the ugly page reload per request, XUL focus for desktop is currently an advantage for web applications, page reload can be fully avoided using AJAX.
Item 3 can change, may be ItsNat is the first framework server centric with XUL and AJAX support.
In summary, the first paragraph is the main unsolved problem, true XUL applications only work in Gecko browsers. Fex and AIR are proprietary solutions trying to conquer the world of application development outside the web (Flex runs on top of the web), why can not XUL, a really web based technology, be a first class technology?
Flex is executed on top of Flash plug-in, what about an Active X embedding FireFox in Internet Explorer? Why is this Active X abandonware?
In desktop Prism is trying to push FireFox as a platform for desktop applications much like AIR is doing, why not these applications in XUL?
Can XUL have a rebirth as a web application platform? Can the XUL component system be a future standard for web development adopted by other browsers? Or is it too late?
- Login or register to post comments
- 5341 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)










Comments
sperlab replied on Thu, 2009/06/18 - 4:17am
Glad to hear about Xul, one of my new best friend.
2 years ago, I designed a xul/rdf/xbl RIA based framework, architected among other goodies such as Spring / Apache Cayenne / Hsqldb / Direct Web Remoting (Ajax, Reverse Ajax) / Jawr and few others powered by an apache tomcat HA cluster with session replication enabled.
I now use it every day to build portal applications (Business Intelligence, CAM, technical data search engines, CRM)
I have never seen more efficient user adoption and so positive feedback. Mozilla client (firefox) is easy to deploy and maintain with msi builds even in huge Microsoft legacy corporate information systems. NTLM / Kerberos is doing the sso stuff, responsiveness in far business agencies with low 256kbps connections is good. It is even usable on low end GPRS mobile devices.
TCO has never been so low for a complete and efficient web portal architecture !
Well, as you said, XUL is not a new option for remote web applications, Xul has always been an option for remote web applications since its birth a very long time ago.
It is simply the most efficient option as long as you're ready to cope with a steep learning curve.
Dapeng replied on Thu, 2009/06/18 - 4:19am
i have been hacking xul for a while, the biggest headache so far is the lack of a solid documentation
Arek Stryjski replied on Thu, 2009/06/18 - 4:44am
People are looking for solution to build Firefox add-ons without XUL https://jetpack.mozillalabs.com/ I belive it says it all.
This article http://www.osnews.com/story/21529/Mozilla_and_Google_Announce_HTML-Based_Extensions sugest even what one day XUL may be used only for backword compatibility.
Reid Atherton replied on Thu, 2009/06/18 - 11:30am
Jose Maria Arranz replied on Thu, 2009/06/18 - 2:37pm
in response to: areks
I think you missunderstand XUL, XUL is a markup based component system used in Gecko browsers, XUL was invented because HTML falls sort to provide a powerful, compact, extensible and cross-platform UI system, for instance to develop the FireFox chrome and extensions or the UI of programs like Thunderbird, SongBird, or Flock. This is because Gecko browsers uses XUL for the UI.
HTML is very basic, in HTML there is no menu component, no built-in trees, for instance this example shows XUL menus: source, online view (use FireFox/Gecko browser)
You can achieve the same behavior generating custom HTML and JavaScript code from server using XUL-like (in fact many server centric web frameworks are inspired in XUL including JSF), this solution requires a generation tool, and is not easily customizable, that is, in XUL you can customize XUL components using JavaScript and CSS your menu, including menu items in generated HTML there is no clear correspondence with the original markup.
The article cited by you is a personal opinion, is not the official intention of Mozilla guys, may be you are right XUL is almost not used for remote applications, notwithstanding it has been highly successful for doing cross-platform UIs in local, thanks to XUL you have Thunderbird, FireFox etc running in any operating system and processor.
My statement is following: now AJAX is widespread and XUL is widespread, is a web technology. AJAX promotes Single Page Interface and desktop like applications, and XUL was invented to provide UI controls similar to desktop counterparts. JavaFX, Flex, AIR are nice, though we have right now in our installed FireFox a powerful and web friendly component system ready to be used in remote Single Page Interface web applications. Of course XUL hardly can replace JavaFX, Flex, AIR because multimedia is not the focus (in spite of SVG we still need to wait for canvas, video etc in HTML5), but XUL is appropriated for data management applications.
In summary, XUL in the client and an AJAX intensive web framework generating XUL can be a perfect match for certain web applications (Single Page Interface) if multiple browser support is not a problem.
JetPack tries to provide hot deployment of extensions, a FireFox extension can take control of low level capabilities, this is the reason you need to restart FireFox because low level rights are given only to the already installed extensions in launch time. This has nothing to do with the namespace used, X/HTML or XUL, furthermore, in XUL markup you can extensively use embedded HTML.
jamesjames replied on Fri, 2009/06/19 - 1:07am
sperlab replied on Fri, 2009/06/19 - 3:50am
in response to: jamesjames
What a shame !
Anyway, look at your statement, replacing Xul by Java:
There is no Java specification out there and no complete documentation. How would anyone dare to support it? It changes all the time. Java was never meant for mainstream use. It is designed to create a consistent and cross platform environment and browser extensions. It is not easy to use and to me over bloated. However, I like Applet technology :) and it is something worth trying Java for.
That sounds like something i've heard kind of 10 years ago, didn't you ?
jamesjames replied on Fri, 2009/06/19 - 3:57am
in response to: sperlab
sperlab replied on Fri, 2009/06/19 - 4:06am
in response to: jamesjames
Well, Java is near 15 years old.
And Mozilla is not Sun, i agree with you for that.
jamesjames replied on Fri, 2009/06/19 - 4:08am
in response to: sperlab
sperlab replied on Fri, 2009/06/19 - 4:36am
in response to: jamesjames
You read, i build and design.
Obviously, that makes your arguments much more coherent and intelligent !!!
sperlab replied on Fri, 2009/06/19 - 4:31am
in response to: jmarranz
I choose Direct Web Remoting (DWR) as an ajax library. It fits perfectly within mozilla's xul designed web UIs by just extending engine.js cookie management.
I use prototype and swfobject as well to get form validation and flash integration directly within a Xul page.
rfordinal replied on Fri, 2009/06/19 - 5:16am
jamesjames replied on Fri, 2009/06/19 - 5:26am
in response to: sperlab
huh?
>Obviously, that makes your arguments much more coherent and intelligent !!!
You got that part right (I guess).
sperlab replied on Fri, 2009/06/19 - 6:24am
sperlab replied on Fri, 2009/06/19 - 6:59am
jamesjames replied on Fri, 2009/06/19 - 8:19am
in response to: sperlab
Huh? are you somekind of a joke? why dont you just go and throw yourself from a cliff? that would definetely help you with your English skills. This is the second one in two weeks. I may just stop commenting on this board.
sperlab replied on Fri, 2009/06/19 - 8:52am
in response to: jamesjames
As a matter of fact, i live in france, and your last comment literally broke my heart.
But please, keep commenting in an intelligent and coherent manner!
Huh? let me guess, did you ever start (at least on this topic) ?
jamesjames replied on Fri, 2009/06/19 - 9:54am
in response to: sperlab
sperlab replied on Fri, 2009/06/19 - 1:16pm
in response to: jamesjames
A score to settle ? By all gods, no.
Maybe you think that talking about XUL on JavaLobby (The heart of the Java developer community) is evil, maybe you think that such crappy piece of technology is blasphema (considering the "pure java-ist" spirit (excuse my poor vocabulary, but is there anyone in here that use only one language !)).
Java (as a set of technologies) has never provided an efficient (from the end user and corporate point of view) RIA framework.
Mozilla did it very long time ago when the acronym RIA has'nt even been released.
Having read a lot about RDF/XUL/XBL, and having built a lot of remote xul web apps, i can assure you this is great piece of technology.
It is sometimes interesting to talk about technologies that simply do the job and then try to find the better of different worlds. Thanks to the author of this post for that.
Jose Maria Arranz replied on Sat, 2009/06/20 - 8:05am
in response to: sperlab
Nice to know your experience with XUL.
Desktop applications based on Gecko have a sad history, many years ago I envisioned a new generation of desktop applications based on Gecko engine and Java, Java for the business logic and view logic and optionally JavaScript for the view logic, and Gecko for XUL/XHTML/SVG rendering. A simple development environment to integrate Java and Gecko (a Java-XPCOM bridge) would be necessary, but this approach never took off, part of the problem is Java has ever been marginalized in Mozilla world and Sun (and Java ecosystem) ignored this path maybe conscious because they were trying to push AWT first and then Swing.
The fact is there is (almost) no Java-Gecko desktop application and FireFox extensions are ever built with the weak JavaScript and sometimes with the complex and rigid C++
sperlab I'm going to release a new version of ItsNat with XUL support very soon, if you want to try right now a pre-release contact with me.
sperlab replied on Sun, 2009/06/21 - 5:34am
in response to: jmarranz
I started a new project 2 months ago. I would be glad to give itsnat a try for it as an alternative to my own RIA framework, which is quite hard to maintain due to its numerous dependencies.
The idea is to integrate ECM functionality within existing remote-xul applications.
ECM engine and repository is Alfresco 3.x., application will be using alfresco WebScript API to achieve all the ECM stuff.
I was inspired by :
http://code.optaros.com/trac/docasu/
I'm also looking for the best way to build a complete xul alfresco front end to maximize ease of use and responsiveness.
tiffanyjewelry replied on Fri, 2009/06/26 - 2:46am
David Boswell replied on Thu, 2009/07/30 - 5:48pm
It's interesting to hear how you're using remote XUL. If the projects you're working on aren't already listed on the list of mozilla-based applications, please feel free to add them yourself or send me the information and I'll update the page at
https://developer.mozilla.org/En/List_of_Mozilla-Based_Applications
shahzadsarwar replied on Sun, 2009/11/01 - 10:49pm
I loved it so much that I hacked the c++ code so that I could write remote application with ease without the security model getting in the way.
Mozilla keeps targeting downloaded application such as extensions but not an easy way to run remote application without doing some mods.
Maybe we XUL lover should get together and start something!