Sans Browser

Archives Posts

XULRunner File Remove Bug and Work-around

January 12th, 2009 by enefekt

I’m working on a tool based on XULRunner that generates some content. (HTML content, images, etc.) It produces a directory to put the content into, and then offers the user the option of viewing that content right away.

The problem lies in leaving that content open in a another application like a web browser. Upon returning to the tool, and attempting to re-publish the content, an NS_ERROR_FAILURE exception is thrown coming from the nsIFile.remove call to remove the directory recursively. This is because of some sort of file exclusivity the web browser process has already.

So easy, just catch that error, inform the user to close their content in any other open application, rinse and repeat, right? Well unfortunately under XULRunner on Mac OS 10.5, the initial failure gunks up any further attempts. So even reinitializing a new nsIFile instance doesn’t work. Only restarting the app works! Yech.

Well I found that manually doing a recursive loop and removing each file individually, and then removing the parent directory, works. Definitely not efficient, as the native code would be better over JavaScript. (TraceMonkey should help with this right?) But there isn’t a grossly high number of files or that deep of a hiearchy anyways.

So meanwhile over on Windows, that technique throws it’s own lovely exception. But on Windows, catching the initial exception, and warning the user about files open in other application and closing them, works fine, so thats what I’m using over there.

Archives Posts

XUL Dark Matter Series: Phloneme

January 12th, 2008 by enefekt

I’m continuing with my XUL Dark Matter series, which I started with TabPress, a visual editor for simple tabbed content. (Which is at 0.3 now and has theme support)

Now I’ll be looking at Phloneme. Phloneme is a desktop authoring tool as well. It is currently configured to work hand-in-hand with Vocab Collab. Unlike the other XUL projects that I’ve done, Phloneme and Vocab Collab are personal projects that I’ve done in my scant personal free time. I wanted to discipline myself in sticking with something and finishing it through, and this combo was the guinea pig!

(Now, evangelizing a project is a whole different beast and I’m not really pushing that real hard right now with Phloneme and Vocab Collab, but if you know someone interested in the subject domain, pass it along!)

So the whole point of Phloneme (Combination of flow and phoneme), is to write rhymes. It allows you to create, edit, save and publish rhymes directly to Vocab Collab.

The interesting part of the whole thing comes from the ability for the author to easily create structured content, and then push that structure online in the form of a special microformat I’ve created just for rhymes. The structure they add are user-defined rhymes.

The authoring tool allows the user to designate rhyming words in a highly visual way. This is all edited and kept track of through microformat style overloaded class attributes. The document format is XHTML. The editing is taken care of via the awesome Mozilla Midas Spec.

So when the user publishes online, you get all the structured rhymes inserted into the database. The visual display of the rhyme also matches that in the authoring tool, since they can use pretty much the same CSS and everything.

One of the cool advantages of the structured content can be seen in the search feature in Phloneme. You can search for rhyming words for a particular word, and it will return live results from Vocab Collab.

If the user simply wants to copy and paste some rhymes from a search result into his own document, an automatic attribution and link will be created, so once published it will link to the work it derived from. That brings up another feature that I’ve added, which is the ability to select a Creative Commons license when publishing.

This was just one of those personal project ideas that I thought would be cool. Don’t really know what to do with it now. I sure did learn a lot about XULRunner, XUL, and the Midas spec while working on it though.

If you would like to play around with Phloneme, go ahead and have fun. You don’t need a Vocab Collab account unless you plan on publishing. Bust a rhyme!

Getting started tutorial on Phloneme. (With some screenshots)


I’m not done with the XUL Dark Matter series, still have a couple to go yet!

Archives Posts

XUL Dark Matter Series: TabPress

September 4th, 2007 by enefekt


I have been working on an authoring tool code-named TabPress. This is being built on XULRunner and is meant to be a relatively simple tool to create small learning objects delivered in a tab container.

I am experimenting with a different way of editing structured/complex content utilizing the editor and overloaded images. So far it’s working decently, but I need to conduct some more usability tests to flesh things out further.

Some quick points about the app:

  • Uses XSLT for publishing
  • Publishes content using YUI components
  • Opt-in Creative Commons licensing
  • Streamlined SWF insertion
  • Streamlined MP3 player insertion

It’s in an alpha state without any user documentation at the moment. Feel free to play around with it though and see whats discoverable. Just wanted to get this early version out there and make sure it doesn’t end up as dark matter. :)

Now at 0.3, there has been some bug fixes, enhancements with visual editing capabilities and support for themes when publishing.

TabPress 0.3 – Mac UB (20.4 MB)

TabPress 0.3 – Win (7.6 MB)

Filed under Mozilla, Mozpad, XULRunner, XULRunnerApp having Comments Off

Archives Posts

XULExplorer 0.4 for Mac [Updated]

June 22nd, 2007 by enefekt

Since I noticed that Mark Finkle’s download slot for XULExplorer 0.4 for Mac was still labeled as “coming soon”, I figured I would whip up a Mac distribution. So I grabbed the source from Subversion and did just that.

Some things I got errors on:
I didn’t see a “tasksOverlay.dtd” file, so I just disabled those entities in “inspector.xul”.
There wasn’t a “venkman-overlay.dtd”, but I found one via Google and slammed that in there.

So I guess this isn’t an “official” distribution, there prolly is some stuff not 100% right. The app bundle directory arrangement might be a little different too, since I slapped the source into my own build process, and created the distribution from that.

Oh, and I used XULRunner, what I had laying around. I guess it’s not a UB. If I do this again, the next one will be. (Should still work fine on Mac Intel, will double-check when I get on my Macbook Pro later today)
Update: Works fine on Mac Intel, forgot that gives you a UB, will update this weekend sometime.
Update 2: Now a (fat) Universal Binary

Here it is:
XULExplorer 0.4 – Mac (Universal Binary – 19.2 MB)

Archives Posts

eMusic Download Manager

April 21st, 2007 by enefekt

New XULRunner app by eMusic. It’s called the eMusic Download Manager. Very cool example of tailoring an experience for an online app with an IDA to overcome browser limitations. One of the main goals is described here:

Our goal is to rid ourselves of years of issues with downloading and to give you an experience that should help you rock-on without having to worry about how to download.

Filed under IDA, Mozilla, XULRunner, XULRunnerApp having Comments Off