fgnass / spin.js

A spinning activity indicator
http://spin.js.org
MIT License
9.3k stars 1.02k forks source link

UIWebView stylesheet issue #259

Closed DaveStein closed 9 years ago

DaveStein commented 9 years ago

It appears that in some UIWebViews, style never gets defined. After minification on my site, this line errors with n is undefined

return m[e] || (n.insertRule("@" + i + "keyframes " + e + "{0%{opacity:" + g + "}" + f + "%{opacity:" + a + "}" + (f + .01) + "%{opacity:1}" + (f + b) % 100 + "%{opacity:" + a + "}100%{opacity:" + g + "}}", n.cssRules.length),

This actually tells me that the sheet function is failing somehow.

  var sheet = function() {
    var el = createEl('style', {type : 'text/css'})
    ins(document.getElementsByTagName('head')[0], el)
    return el.sheet || el.styleSheet
  }()

I have been unable to reproduce, but I am getting logs to my server that show this happening fairly often. I am in the process of improving our logging to hopefully know what version of UIWebview.

I debated opening this ticket before getting more info, but thought I should throw it out there sooner than later in case someone else runs into it.

DaveStein commented 9 years ago

And just as an FYI for people to search in the future, the user agent here was actually: Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)

We had thought it was webview since our parsed version gave Mozilla version 0.

Gonna close this since I don't think anyone cares if a spider is causing such an error. Reopen if you disagree!