Showing posts with label Firefox. Show all posts
Showing posts with label Firefox. Show all posts

Monday, November 10, 2008

Another Mobile Browser - Mozilla Fennec - under Alpha Testing

After Opera, Safari, IE Mobile, Chrome Mobile, we are welcoming another mobile browsers: Mozilla Fennec. Currently, it is still under alpha testing. Anyone are welcome to alpha test it. If you don't own a N810 Internet Tablets, you can still try it out on your desktop. I am more intested when this will go to Android OS powered phones like G1 and PSP, but there is no luck in the near future, because Fennec is not written in Java and Android does not support applications that run directly on the operating system itself without the need to be written in Java. I am hoping that Google will do the right thing and make a deal with Mozilla so that we can have Fennec soon on G1.

Here is the brief feature list and working UI for Fennec.
Read more!

Thursday, June 26, 2008

Use xmlHTTPRequest for Accessing Local Files

here are some of my experiences working with xmlHTTPRequest object to open local files.
xhr.open("GET",localFile,false);          
httpRequest.onreadystatechange = function(){
if (xhr.readyState == 4) {
if (xhr.status == 200) {
//blahblah...
} else {
//blahblah...
}
}
xhr.send(null);


First of all, there will be exceptions if you trying to access a local file that doesn't exist. Instead of returning 404 status code, it throws out an exception. In addition, the status code from opening local files will be 0. Below is quote from Mozilla website for xmlHTTPRequest object.

file:/// and ftp:// do not return HTTP status, which is why they return zero for status and an empty string for statusText. please refer to bug 331610 for more insight.

I didn't find any IE related document to xmlHTTPRequest object, but from my test, it also return 0 for file:///.

Below is the modification to original code
try {
xhr.open("GET",localFile,false);
httpRequest.onreadystatechange = function(){
if (xhr.readyState == 4) {
if (xhr.status < 300) {
//blahblah...
} else {
//blahblah...
}
}
}
xhr.send(null);
} catch (ex) {
//blahblah...
}


Read more!