security error on Firefox 7.0.x #36

Closed
dhaval2025 opened this Issue Oct 3, 2011 · 16 comments

Projects

None yet

5 participants

@dhaval2025

Spin.js errors out on firefox 7.0.x , it error out on line 64 saying Security error '}', 0);

NB: I am trying to use spin.js within an iframe

Thanks
Dhaval

@fgnass
Owner
fgnass commented Oct 5, 2011

Can you send me a link to an example?
Is the content of your iframe loaded from the same domain as spin.js?

@dhaval2025

Hey I am sorry but I don't have a public link yet, but I can tell you that the iframe url is www.Adomain.com,

but all the markup, scripts and stylesheets within the iFrame load from www.Bdomain.com.

Also this works great on chrome and ie7+

@dhaval2025

Update::

Hi,
Just wanted to give you an update that It hasn't been working on any firefox, Till now I was just trying on 7.0.x but I just tried on other Firefox versions and haven been getting the same security error on Line 64 of spin.js

Thanks
Dhaval

@phishbot

I'm also having the same issue.

I think this is happening on Line 58 for me -- with respect to "sheet.insertRule"

It looks like a Cross-Domain issue. In my specific case, my JS/CSS are hosted on CDN (different domain).

@fgnass
Owner
fgnass commented Oct 14, 2011

Hm, I wonder if inserting <style type="text/css">/* CSS rules here */</style> would make any difference.

@fgnass
Owner
fgnass commented Oct 18, 2011

Hi everyone! Could you please try this again with the current HEAD? It contains a fix for issue #39 which is probably related to this error.

I noticed that in FF documents.styleSheets[documents.styleSheets.length-1] always is the Firebug CSS (if installed), which might also explain the security error. If that's the case, the patch for issue #39 should fix this, too.

@fgnass fgnass referenced this issue Oct 18, 2011
Merged

Fix for issue #39 #40

@phishbot

While it fixes the error in Firefox, this creates a new issue in Safari.

. line: 61
. message: "'undefined' is not an object (evaluating 'sheet.insertRule')"
. sourceId: 4743268672
. sourceURL: "http://localhost/lib/Javascript/spin.js"

@fgnass
Owner
fgnass commented Oct 18, 2011

Unfortunately I still can't reproduce this issue. Viewing example.html (from the master branch) works in Safari (5.1.1) even if I load spin.js from another domain (raw.github.com vs. localhost) or include an external stylesheet. @phishbot Any chance you could post a link to a non-working example?

@eych
eych commented Oct 28, 2011

One more idea how this can be fixed — 974cdd3#commitcomment-681824

@fgnass fgnass added a commit that referenced this issue Oct 29, 2011
@fgnass Possible fix for issue #36 930bae7
@fgnass
Owner
fgnass commented Oct 29, 2011

I pushed another version to the master branch which uses the sheet or styleSheet property of the inserted style element. Still needs some more cross-browser testing. Let me know whether this works for you.

@phishbot
phishbot commented Nov 4, 2011

This is still an issue for me in Firefox 7.0; it works fine in Firefox 3.6 , Chrome, and Safari.

You can see it broken here:

http://beta.tumblecloud.com/cloudpage/?cloud=438

@phishbot
phishbot commented Nov 5, 2011

One note : it works if you have Firebug up, but is broken without it.

@phishbot
phishbot commented Nov 5, 2011

here is another test link which is more accurate
http://unstable.dev.tumblecloud.com/cloudpage/?cloud=4705&

@phishbot
phishbot commented Nov 7, 2011

woops! it looks like it did fix all our issues with it. Thanks eych!

@fgnass fgnass added a commit that referenced this issue Nov 8, 2011
@fgnass Merge branch 'master' into gh-pages
* master:
  Defaults are now exposed as Spinner.defaults
  Added float:left for #preview
  Possible fix for issue #36
  Wrapped the code into a function expression to keep the local scope tidy
  fix for issue #39
d2122c6
@fgnass fgnass closed this Nov 8, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment