fgnass/spin.js — Issue #39: Security error if last stylesheet is different domain
Author: mjphaynes
Created: 2011-10-18 14:16:18+00:00
State: open

Hi,

The issue is with this line:

var sheet = document.styleSheets[document.styleSheets.length - 1];

If the last stylesheet is not on the same domain it throws a security error, for instance I was loading a google font at the bottom of the page:

The sheet selection needs to be more intelligent by selecting the stylesheet that it just created rather than just the last one in the document.

Thanks.