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 »

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 »