Last listened to Symphony No. 4 in G (1993 Digital Remaster): III. Ruhevoll by Paul Kletzki (on 6 Sep 2010, 05:25)

Google Chrome broke my Firefox 3!

After reading about the new Google browser, Google Chrome, I decided to try it out and see for myself how it compared with Firefox and IE.

Initially I was impressed by its clean interface and its homepage feature which displays thumbnails of the websites you use most. It even imported my Firefox bookmarks neatly - although I later found out this process had broken various things in firefox. Let me explain...

The next day, with Firefox still my default browser, I was browsing around (I forgot I had Chrome installed), when I realised that several things in Firefox were behaving strangely. See the screen capture of firefox below:

Firefox broken by Google Chrome

  1. Pretty much the whole of the firefox bookmarks features were now broken and I feared all my bookmarks had been deleted. My firefox bookmarks toolbar was suddenly empty (this had all my RSS feeds on, and my favourite websites) and the bookmarks menu was empty. I'd also lost the ability to add any new bookmarks and couldn't use the "manage bookmarks" feature either. Very annoying.
  2. The address bar was behaving strangely. If I typed "bbc.co.uk", it would normally redirect me to the full address ("http://www.bbc.co.uk/") but now, for some reason, the address bar didn't change, ever, even if I clicked my way off the BBC website and onto another site. It still had "bbc.co.uk" in the address bar, exactly as I typed it.
  3. The icon that indicates that a page is loading was continually telling me it was loading something, even when it had clearly finished loading.

All of this happened straight after I installed Google Chrome Beta, and imported my bookmarks from Firefox. I have now uninstalled Google Chrome permanently, and had to reinstall Firefox to fix what Chrome had broken, and am going to stick to Firefox until I'm sure that Chrome is more stable. Here is a picture of Firefox, reinstalled, and back to it's fully working state:

Firefox fixed again

I'm sure Google Chrome has many advantages - but I'm going to wait a while until I find out what they are!

By the way, I'm posting this complaint using Firefox 3 - go and download it now if you haven't already :-)

When using an ASP.NET File Upload control (or the HTML equivalent) it's worth remembering that when you come to use the FileName property in your code, it annoyingly has different values depending on what browser you are using.

If you have one of these on your page...

<asp:FileUpload id="FileUpload1" runat="server" /> 

... or the HTML version...

<input id="FileUpload2" runat="server" type="file" />

... when you come to get the name of the user-selected file in your code (which for example was a file picture.jpg in C:\Pics\), you will get the following results depending on the users browser:

Control: FileUpload1 FileUpload1 FileUpload2 FileUpload2
Property: FileName PostedFile.FileName Value PostedFile.FileName
Firefox 2 picture.jpg picture.jpg picture.jpg picture.jpg
Firefox 3 picture.jpg picture.jpg picture.jpg picture.jpg
IE7 picture.jpg C:\Pics\picture.jpg C:\Pics\picture.jpg C:\Pics\picture.jpg
Opera 9 picture.jpg picture.jpg picture.jpg picture.jpg
Safari 3 picture.jpg picture.jpg picture.jpg picture.jpg

As you can see, it is Internet Explorer that is the odd one out. What this means is that you can't rely on using the FileName property without first checking the value and trimming out the unwanted file path. For example, to get picture.jpg no matter what browser is used, you'll have to do something like this:

string file = FileUpload2.PostedFile.FileName;
int slash = file.LastIndexOf("\\");
if (slash > 0) file = file.Substring(slash, file.Length - 1);

Don't let this catch you out.