(This reminds me, if you don’t yet subscribe to The Burning Edge, I highly recommend it; it does weekly recaps of the changes that have gone into Firefox, highlighting important features or bug fixes.)
These two properties have long been a part of Internet Explorer and are now making their way into Firefox. This is to complement the
clientWidth properties that already exist.
What these properties provide can be best described through a diagram; luckily, the Mozilla Developers Wiki already has some nice ones, so I’m just going to repost them here:
While they’re not terribly exciting properties to have, it’s good to finally have a full set to work with.
Set-Cookie: sessionid=1234567; domain=mozilla.org; HttpOnly
This is an interesting feature that doesn’t, yet, have a specification-home (although, some suspect that it’ll be adopted by the WHATWG). It provides the ability, for the user, to specify individual resources for special caching, should the browser move into offline mode.
In my personal tests, I was able to get it such that an XML file, specified exclusively as an “Offline Resource”, was able to be retrieved, using an XMLHttpRequest, even while being disconnected from the Internet. You can view a demo here (Make sure that you’re running, at least Firefox 3.0a3.) The relevant code, from the test page, is as follows:
The important line being: [html][/html] which allows you to make the browser pre-cache the test.xml file, for later use. This can be done with a number of resource files (CSS, Images, etc.) and is not just limited to pieces of data; which makes it immensely useful. Mark Finkle has some more details on his blog.
[js]var str = “mouse dog mouse cat dog”;
str = str.replace(/ dog/y, “”);
>> str == “mouse dog mouse cat”[/js]
[perl]my $str = “mouse dog mouse cat dog”;
$str =~ /cat/;
$str =~ s/\G dog//;
>> str eq “mouse dog mouse cat”[/perl]
A minor, but useful and important, feature addition to the built-in Firefox DOM Inspector. This new feature is perfect for performing additional testing on live pages, to see their effect. A quick demonstration of how it works:
There’s a new menu option allowing you to insert a node in relation to the selected node:
Once selected, you can then insert an element (with namespace) or a text node:
Giving you a nice new result:
How to try all of this at home!
Mozilla provides full builds of the latest bleeding-edge installs. You can find them linked to the individual Burning Edge blog posts, or at the following URL: