Issue 93: Export CSS on Chrome
Status:  New
Owner: ----
Reported by jonas.ca...@gmail.com, Sep 28, 2011
What steps will reproduce the problem?
1. Visit spriteme.org
2. Get SpriteMe as bookmark to work (needed to clean up some characters in an editor, before I came up with a solution that was more straight-forward — to inspect element and copy link address and edit the bookmark content).
3. Get Firebug Lite working.
4. Start the demo.
5. Go through all steps.
6. Try to export CSS.

What is the expected output? What do you see instead?
Error in Firebug Lite: "Uncaught TypeError: Cannot read property 'length' of null (spriteme.js,695)"

What version of the product are you using? On what operating system?
Mac OS X 10.6.8
Chrome 15.0.874.24 beta

Please provide any additional information below.
686. 			var aRules = [];
687. 			try {
688. 				aRules = ( SpriteMe.bIE ? stylesheet.rules : stylesheet.cssRules );
689. 			}
690. 			catch(err) {
691. 				hRestrictedStylesheets[url] = true;
692. 			}
693. 
694. 			// Loop through each rule
695. 			for ( var r = 0, nRules = aRules.length; r < nRules; r++ ) {

Obviously there is something about line 688 causing the null-object — but I leave it up to you guys to figure out a solution that suits best...

Maybe skip SpriteMe.bIE and write:
aRules = ( stylesheet.cssRules? stylesheet.rules : stylesheet.cssRules );

As suggested here: (http://www.javascriptkit.com/dhtmltutors/externalcss3.shtml)
var firstrule=mysheet.cssRules? mysheet.cssRules[0]: mysheet.rules[0]
Sep 28, 2011
#1 jonas.ca...@gmail.com
Expected output is of course the CSS — posted only the error.
Sep 28, 2011
#2 jonas.ca...@gmail.com
And of course the other way around in my suggestion:

aRules = ( stylesheet.cssRules? stylesheet.cssRules : stylesheet.rules );