1

i have a nice pageFlip website running fine in Safari-Browser on iPad2. If i now create a UIWebView within my new App and opening the URL to this PageFlip Site within the WebView, the Pages are not displayed the same as in Safari.

Are there known differences between Safari and UIWebView?

The PageFlip Site does a lot of JavaScript, checking the browser and also the screen resolution.

Also some functionality (JavaScript) does not work in UIWebView, but in Safari on the same device.

MadMaxAPP

MadMaxAPP
  • 1,035
  • 2
  • 16
  • 39
  • duplicate: http://stackoverflow.com/questions/3496505/differences-between-uiwebview-and-mobile-safari – William Niu Nov 04 '11 at 09:24
  • Hey madmax .. I am facing the same problem as you stated in this question .. what solution did you find for this? see this ..http://stackoverflow.com/questions/8118750/not-able-to-get-button-click-event-of-a-website-in-uiwebview-iphone – Jean-Luc Godard Nov 14 '11 at 10:41
  • I found no solution up till now! ObjectOberserver.InterfaceOrientation always returns "portrait" instead of "landscape" if divide is in landscape. – MadMaxAPP Nov 14 '11 at 12:36

1 Answers1

1

iOS 4.3 introduced the nitro JS engine to mobile Safari, which uses JIT for increased performance, but for security reasons JIT is disabled for UIWebViews.

My guess would be that UIWebView still runs the pre 4.3 JS engine.

voidStern
  • 3,678
  • 1
  • 29
  • 32
  • iOS5 introduced Nitro for UIWebViews. – sciritai Nov 03 '11 at 19:57
  • That means that Content should be displayed and handled the same way on UIwebView and Safari? – MadMaxAPP Nov 03 '11 at 20:19
  • If you are on iOS5 it should be the same, however if you are using 4.3 or earlier it might not render exactly the same. – hatunike Nov 04 '11 at 21:29
  • I'm on iOS5! I'm banging my head for three days now, why the interfaceOrientation always is returned as portrait in UIWebView and in Safari it's correct returned as landscape. – MadMaxAPP Nov 06 '11 at 08:33
  • This is probably not a problem with `UIWebView`, but with your native code. Did you implement `- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation` through out all your viewControllers – voidStern Nov 06 '11 at 09:35
  • The View itself is displayed in Landscape. I did implement `- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation` in the View containing the UIWebView. The Code inside is `return (interfaceOrientation==UIInterfaceOrientationLandscapeLeft);` – MadMaxAPP Nov 06 '11 at 10:58
  • Seems that there is no solution for that so far. There seems to be something handled differently in UIWebView than in mobile safari. Couldn't find a solution... – MadMaxAPP Nov 21 '11 at 12:50