Keypress Event Does Not Work in Chrome For Escape Key

It is very common these days to allow your web page to respond to your website users using key shortcuts. Recently I was working on a project to display an overlay on top of a page (lightbox style), and the third party that I used is called iBox. It worked great and very light weight, but it had a problem with “Escape” key to get user back to the web page, i.e., hide the overlay. This is what the coder used (slightly modified version):

    window.addEventListener('keypress', function(e){
        if (e.keyCode == (window.event ? 27 : e.DOM_VK_ESCAPE)) {

The code is simple, We just want when user presses the “Escape” key on the keyboard to hide the overlay that was displayed on the screen. This worked in latest FF, but not in Chrome. And looks like it does not work for all the keys on the first line of my keyboard (I use Mac keyboard, not sure whether this is the cause of the issue or not).

In order to capture the this event, I need to use “keydown” instead:

    window.addEventListener('keydown', function(e){
        if (e.keyCode == (window.event ? 27 : e.DOM_VK_ESCAPE)) {

Problem solved, but not an obvious one. Hope this helps.

Can’t Setup Chrome Sync

I have been trying to setup Chrome Sync for my MacBook Pro and home desktop for a long time, but never be able to get it working on my desktop at home. The setup kept at the “Setting Up” screen forever.

After googling I found out that some people had the same issue, and it was caused by corrupted AutoFill data. All I needed to do was to untick “AutoFill” in the “Configure Sync” page.

Now I can get all my data synced, and I don’t care about AutoFill anyway.

Dislike The New Chrome Icon

Today I have noticed that a new Chrome 2D icon appears on my Dock

I have seen the news on mashable last month, and I had already said that I don’t quite like it.

Now I have to say that I totally dislike it after the update. It just looks so weird. What choice do I have now?

Maybe time will change my opinion in the future.

Move to Chrome as Main Development Environment

I have been using Firefox as the main tool for web development for the past few years. However I am getting sick and sick to the memory management in FF, it is so poor that it simply doesn’t release any unused memories at all, even if you close down all your tabs except one.

Chrome is my favourite browser now with its speed and simplicity, although the development tools for it is not as mature as Firefox, it has started to catching up. Firebug Lite for Chrome has been very useful and the internal development tools of Chrome have been helpful as well, especially the resource tracking tool that is missing in Firebug Lite:

I have already dumped Firefox at home ( not even install it ), and I will be dumping it at work as well and move completely to Chrome.

Google Toolbar for Chrome

If you are looking for solutions to install Google Toolbar in Chrome, bad luck, you are in the wrong blog. The answer is simply no, there is no to such toolbar for Google’s new Chrome browser.

This is what surprised me the most. I have been using Google toolbar for bookmark and translation tools for years. How could Google had no plan to have it default installed in the new browser?

I tried Chrome last night from my home computer and the experience was good. It is very light and fast, much faster than Firefox and IE. But I don’t think people will just switch to a new product if there are lots of features that they use everyday are missing. I posted a question on LinkedIn regarding installing GToolbar in Chrome, and all answers are simply no no no.

Google Toolbar for Chrome

All we need to do is to wait for further development which will then support extensions like Firefox.

Be patient, for the time being, stick with Firefox.