Posts Tagged ‘firefox’

Links^2 – September 13th, 2010

Monday, September 13th, 2010
  • The Official Guide to HTML5 Boilerplate
  • Stylebot – a Chrome extension that lets you customize any site’s CSS, like Firefox’s Stylish, or a Greasemonkey for CSS. Great WYSIWYG UI.
  • Firefox 4.0 beta 5 – I’ve been using FF 4 since beta 2, and I’m very pleased. In order to have all add-ons skip the version check, go to the url about:config, create a new boolean key named extensions.checkCompatibility.4.0b with the value of false. Restart FF and most of the add-ons will work.
  • CSS3 Playground - Yet another CSS3 WYSIWYG
  • SmartGit – A UI client for Git. Available for Mac/Windows/Linux

Elad Ossadon
September 13th, 2010
2 Comments »

Bug: Chrome’s for..in Loop Messes the Order of the Indexes

Tuesday, July 13th, 2010

Yes. I know I should never rely on for..in loop order, but when it comes to inconsistency of browsers it can be annoying.

I found it out when I wanted to fetch the first key of an object, but got different results on chrome (incorrect result) and other browsers.

Code:

console.log("wordsAsKeys");
var wordsAsKeys={ words:"value",as:"value",keys:"value" };
for (var k in wordsAsKeys) console.log(k);
console.log("numbersAsKeys");
var numbersAsKeys={ "3":"value","2":"value","1":"value" };
for (var k in numbersAsKeys) console.log(k);
console.log("mixedKeys");
var mixedKeys={ "3":"value",words:"value","1":"value" };
for (var k in mixedKeys) console.log(k);

The Result:

Firefox / Safari / IE:

wordsAsKeys
	words
	as
	keys
numbersAsKeys
	3
	2
	1
mixedKeys
	3
	words
	1

Chrome:

wordsAsKeys
	words
	as
	keys
numbersAsKeys
	1
	2
	3
mixedKeys
	1
	3
	words

As you can see, the second and third loops enumerate on an object with numbers as indexes. What Google Chrome seem to do is treat the object as an Array, which outputs the numeric indexes first, in ascending order.

To me, it looks like a bug that may create inconsistency. Google & Chromium team – please fix it :)

Links^2 | June 28th, 2010

Monday, June 28th, 2010
First post in a series to be. Several (very) interesting links I encountered lately.
  • CSS Reloader – Essential FF add-on that reloads external CSS files without refreshing the whole page. A MUST HAVE + time saver.
  • Wow, I’m in love with SASS/LESS.CSS/DotLESS. This is how CSS should look like. Well, these have been around for a long time but after using it once, I can’t imagine I’ll ever go back. All of them offer the same functionality, however, SASS has 2 types of syntax (I chose SCSS which is similar to LESS’s).
  • IE9 new preview promises a lot. W3C compliance and speed. Wait, isn’t it what we wanted?
  • HTML5Rocks – HTML5 playground
  • Smokescreen – Flash to HTML5. A new era?
  • WP Super Cache – If you have  a WordPress blog, this can reduce load times by caching pages to static HTML files. Neat.
  • CSS3 Please TextMate BundleCSS3 Please is a site that shows how to use CSS3 on all browsers. Apparently, as past experience shows, till 2013 or so we’ll have to use specific browser prefixes (-webkit-, -moz- etc.). This TextMate bundle handles all these stuff with code snippets.
  • jsFiddle / jsdo.it – Write code snippets with common JS libraries online, share them, fork other snippets. The first is MooTools driven, the second is jQuery driven.
  • jqueryvsmootools – Why I prefer MooTools over jQuery