cssRules null in Chrome

I found this problem when tryed to use cssRules of document.styleSheets[i] locally in Chrome but found that cssRules is null and only in Chrome. I need only to add some rules but not to read or modify existed rules so this fix is not for all.

Here’s the bug .

And here’s my workaround for this problem:

var styles = document.styleSheets;
var style = null;
for (var s = 0; s < styles.length; s++)
    if(!styles[s].href) {
        style = styles[s];
        break;
    }
if (style == null)
    style = jQuery("text/css\">")
        .appendTo('head').get(0);
var rules = style.cssRules; // is not null!!!