Debugging Web(1) - Live HTTP Headers

Web November 21st, 2006

This problem has been bothered me for quite a long time. Although only 5.4% of my blog readers use MSIE, and I always promote Mozilla Firefox, their browsing experience should not be disregarded by all means.

Here is a good tool to analyzes the underlying HTTP traffic, Live HTTP Headers, if you think WireShark is overkill. This add-on captures all the HTTP header requests and status codes, like this:

Live HTTP Headers in action


Surprisingly, I found that there is also a 404 error in Firefox when accessing /nitfyCorner.css after all the elements are loaded. It is possible that Firefox and other browsers(Konqueror, Opera) just simply ignore the missing style sheet while MSIE refuses to render the whole page at all. I dived into the niftycube.js and found the following code snippet:

var oldonload=window.onload;
if(typeof(NiftyLoad)!=‘function’) NiftyLoad=function(){};
if(typeof(oldonload)==‘function’)
   window.onload=function(){oldonload();AddCss();NiftyLoad()};
else window.onload=function(){AddCss();NiftyLoad()};

function AddCss(){
niftyCss=true;
var l=CreateEl(“link”);
l.setAttribute(“type”,“text/css”);
l.setAttribute(“rel”,“stylesheet”);
l.setAttribute(“href”,“niftyCorners.css”);
l.setAttribute(“media”,“screen”);
document.getElementsByTagName(“head”)[0].appendChild(l);
}

Once the niftycube.js is referenced, the script hacks the windows.onload to add the CSS to the header, however, the hardcoded target is wrong. Since I manually added the style sheet in the header, it always takes effect regardless whether AddCss works or not. After I fixed this bug, MSIE shows the gallery without any problem.

Here arouses another question: how comes MSIE manages to render the blog with the same bug?

Upgrade to Firefox 2

Gentoo October 28th, 2006

Firefox 2 was released two days ago, and I got an upgrade in yesterday’s world update. Compared to Firefox 1.5.x, the speedup is barely noticeable, but there are some neat features I have demanded for a long time:

Built-in spell check This is quite essential for all the bloggers. It marks the typo on the fly, and you can easily add the new word to the dictionary. Unfortunately, I do not find any configuration in the Preference for the spell-check, but I believe that there would be a neat plugin ready in a few weeks to tweak: import/export custom dictionary, more language support, etc.

Search Suggest Yes, I must admit I am a bad speller. The search suggest would help to reduce the key strokes. Google, Yahoo and Answers suggests work out of the box. Other search engine add-on developers may catch on later.

Some joyful surprise:

Javascript 1.7 Javascipt 1.7 steals lots of cool features from Python, I would compare them head to head later.

And some annoyance:

Default ugly font The default font is quite ugly(left), you need to override the font and theme in ~/.gtkrc-2.0:

gtk-theme-name=“Clearlooks”
gtk-font-name=“Bitstream Vera Font 8″

and restart the Firefox(right).

Firefox 2.0 Preview


Backspace no longer stands for “Back” The Firefox 2.0 uses a new set of Hotkeys, the Alt - left arrow is assigned to Back, while the Backspace is assigned to Page Up. Thanks for your consideration for the Laptop users, Firefox team, but I prefer to stick to my habit. Anybody knows how to override the default Hotkey settings?

Update: Thanks to ehh, the solution is in page about.config,
change browser.backspace_action to 0.

Memory leak? It is still unclear whether the core or the add-ons have memory leak problem. Is it feasible for Firefox developers to QA the add-ons listed , and issue “Designed for Mozilla Firefox” certification for qualified add-ons?

Firefox memory footprint


More promotion about the Firefox

Misc, Web September 21st, 2006

I eventually put the Firefox with Google toolbar in the sidebar since Firefox really rocks in the Web development. Here are more slogan from slashdot:

Friends don’t let Friends use Internet Explorer.
TheShadowHawk

‘Yes, firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.’
JZnat

Get Firefox!

Is Google Browser Sync Plugin a troublemaker?

Gentoo July 23rd, 2006

I just installed Google Browser Sync a few days ago, to manage my Firefox profiles across the computers, one in Gentoo, one in Windows XP(VMWare), one in Mac. Today, after the upgrade the world, the firefox failed to launch with this error message:

bookstack@tiger ~ $ firefox
No running windows found
firefox-bin exited with non-zero status (1)

Have I broken something in the upgrade? I double checked the emerge log via genlop, and found nothing relavent. Then I check the strace output:

bookstack@tiger ~/.mozilla/firefox $ strace -e stat64 firefox
… …
stat64(“/home/bookstack/.firefox/*/compreg.dat”, 0xbfefb368) = -1 ENOENT (No such file or directory)
stat64(“/home/bookstack/.firefox/*/chrome.rdf”, 0xbfefb368) = -1 ENOENT (No such file or directory)

It is quite strange that the Firefox would check $HOME/.firefox, it is supposed to check $HOME/.mozilla/firefox instead. There must be something wrong with the current profile. Here we are, the $HOME/.mozilla/firefox/profiles.ini is truncated to zero bytes! Once this is fixed, Firefox works again.

I don’t want to FUD Google Browser Sync, but it is the only relavent change about Firefox. If you have met the same problem, could you drop a comment here? I might need to dig into the source code before jumping to a conclusion.

Google Transit released

Web December 8th, 2005

Google always give us some surprise, a new service named Google Transit has been released in beta test. With open API for Google Maps, nothing but your imagination stops you building creative applications.

Here is a wild idea to create the GPS application using Google maps:

  1. Build an Firefox plugin/standalone web server to communicate with GPSd, convert the NEMA format data to standard XML data source
  2. Inject the Javascript to Google Maps webpage with GreaseMonkey plugin, which would fetch the data from the plugin/webserver, and show the current position in the map.

Update: here is the application powered by greasemonkey.

More advanced features in mind:

  • Cache Google map meta data and reuse it when offline.
  • Voice navigation