New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.4.1 - When included in a iPad WebApp stops working #185
Comments
Works for me using the header
If you're accessing over 3G have you tried over wi-fi? Your problem could be related to this: http://stackoverflow.com/questions/3282373/web-site-exhibits-javascript-error-on-ipad-iphone-under-3g-but-not-under-wifi |
Yes that was the line stripped out from the report. :P However unfortunately I was developing on WiFi - I don't have an iPad 3G - so no luck. Do you have any hint on how I could track the problem, since in WebApp mode it's a bit harder to guess what's happening? From my early test, I can just say that the Raphael() function was "undefined", like it never loaded. :/ |
Are you sourcing Raphael directly from http://raphaeljs.com/raphael.js? For me that never works — I expect Dmitry prevents it to save on bandwidth bills. :-) |
No, it was all self-hosted (OSX, Apache, PHP). That might be one of the places to look. I'll try this evening doing a few tests: even if this isn't going to be a bug, it might be useful nontheless. :) |
Nothing, keeps happening. Same sequence of steps as above, hosted on my Mac's Apache and same result on one of my websites. Could you try with this one, adding to your iPad home as a webapp? |
Ok, got it. In WebApp mode, Safari changes its user agent from:
to:
In v1.4.6 Dmitry changed the way that Raphaël extracts the version number from the browser's user agent to unconditionally assume that the "Version/x.y.z" part is present. Since it's not, the regex match returns null, and so requesting the first element gives a TypeError. |
Interesting and... great! :) |
djw: Thank you very much for your reply, I came across the same problem when including raphael in a webView using Appcelerator's Titanium mobile to build an iphone app. The error happens in the regex on line 2566 of the 1.4.7 version of raphael.js where it tests for the Version in the navigator.userAgent. Changing the order of the 2 tests in the second part of the conditional or adding a test like: navigator.userAgent.match(/AppleWebKit/) before the one which fails will resolve this issue. (I hope this will be addressed by the author) |
I just reported #203 which is apparently the same problem. |
Just to reiterate if you change line 2566 to: if ((navigator.vendor == "Apple Computer, Inc.") && (win.navigator.platform.slice(0, 2) == "iP" || navigator.userAgent.match(/Version\/(.*?)\s/)[1] < 4)) { then everything will work on the iPad in web-app mode. |
fixed |
RaphaelJS 0.4.1: when you try using it within an iPad WebApp stops working, while in Safari it works perfectly.
Reproduction:
The text was updated successfully, but these errors were encountered: