Skip to content


CSS Cross-Domain loading in Chrome and Safari is broken #53

manuelschneider opened this Issue · 3 comments

4 participants


It seems Webkit always hit the 10-seconds timeout when loading a CSS-File from another Domain.

I guess the reason is, that in line 138 those browser won't fire a security-exception for link.sheet - the element is just empty.

I created Demos to help understanding the problem:

NOTE: The interesting part here is the JS-Callback - the CSS applies of course as soon as it's loaded.

I created a patch which should fix this:

  <               if ( link.sheet.cssRules.length )  {
  >               // Chrome won't throw a security or denied exception in case of same origin - cssRules will simply stay empty
  >               if ( (isWebkit && link.sheet !== null) || (isGecko && link.sheet.cssRules.length) ) {

I tested it with Safari 5.1 and Chrome 12.

Last but not least: Thank you for this great tool!


Cool! Thanks for the work on this. Any chance you wanna do a pull request so you get the credz in the log?


@ralphholzmann - you put this fix in the v1.1 stuff, yes? Either way, when we take out the CSS callbacks by default, let's make sure this fix is in the new plugin to support this. We won't pull this into master since we're changing the way it works, but it'll be fixed in the appropriate spot. Many thank yous.


did this not make it into the CSS plugin? cross domain CSS is currently broken in Safari w/the plugin

@SlexAxton SlexAxton closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.