CSS Properties To JavaScript Reference Conversion

Usage

Internet Explorer

document.all.div_id.style.JS_property_reference = “new_CSS_property_value”;

Older Netscape’s (4.7 and earlier)

document.div_id.JS_property_reference = “new_CSS_property_value”;

Netscape 6.0+ and Opera (and other Mozilla)

document.getElementById(div_id).style.JS_property_reference = “new_CSS_property_value”;

Note the use of parentheses instead of square brackets in newer Mozilla’s “getElementById()” reference.

Read the rest of this entry »

XUL-Enhanced Web Apps

This article presents a little-known use of XUL (Mozilla’s user-interface language) and shows how to take advantage of its superior performance and accessibility over HTML while maintaining cross-browser compatibility. I will illustrate this using a proof-of-concept JavaScript library that can render UI widgets using either XUL or DHTML.

If possible, you will want to open this page in Firefox. The side-by-side examples below will not make much sense otherwise.

Read the rest of this entry »

Opening a Link in the Default Browser within XULRunner

XULRunner applications may have situation where they wish to open a URI in the default browser. This will often be an HTTP or HTTPS URI, but can use any scheme for which an external handler exists. This can be done using the nsIExternalProtocolService interface:

Read the rest of this entry »

How to make links that open new windows work in XULRunner-based browser?

Using XULRunner, I’m working on a custom, kiosk-style browser for my
company. When clicking on a link that opens in a new window
(target=”_blank”), nothing happens. The JS console shows “No chrome
package registered for chrome://navigator/content/navigator.xul .” From
an LXR search for “navigator.xul”, I guessed a pref named
“browser.chromeURL” might have something to do with this (though not
referenced by a toolkit/ file), so I added it, pointing to my XUL file.

Read the rest of this entry »

Using Firefox 3 as a XUL runtime environment

XUL is an XML-based interface design language that is extensively used within the Mozilla ecosystem, particularly for the user interfaces of Firefox and Thunderbird. XUL can seamlessly mix with XHTML and SVG content and can be manipulated through the DOM API with Javascript, so it offers a web-inspired approach to cross-platform desktop application development.

Read the rest of this entry »

How to create Firefox extensions

Everyone has a good idea at one time or another to implement a new feature in a web browser. Well, with the goodness that is Mozilla Firefox, now you can do just that. You need to have a vague understanding of XUL and Javascript, but you certainly don’t need to be a master of either. When I started, I knew nothing about either one, really. I had seen some bookmarklets here and there, and tried to figure out just how they worked. Well, that’s how I made my first extension, BugMeNot.

Read the rest of this entry »