I was complained by my boss about the low rendering performance. What is the difference between App using UIWebView and Safari when rendering the same page?
Any help would be greatly appreciated.
UIWebView is deprecated.
From Apple Docs.
Important
Starting in iOS 8.0 and OS X 10.10, use WKWebView to add web content
to your app. Do not use UIWebView or WebView.
#import WebKit
And use WKWebView
WKWebView has much improved JS implementation and use.
It is very similar in performance to Safari.
Differences: WKWebView can be used as a view of your apps controller. Safari runs as a separate app. SafariController runs Safari in it's own app within your app.
Yes there are some difference and similarity in Mobile Safari and UIWebview
UIWebView support all HTML5 features like Mobile Safari
UIWebView is a bit more strict than Safari on certain features. Example: when setting a width/height style through JS, you need to add 'px' behind the number, while Mobile Safari does not require that.
For authentication, UIWebView does not handle authentication challenges automatically, it's up to the developers to handle them.
UIWebView does not have the Nitro Javascript engine, so it executes
JS slower than Mobile Safari.
UIWebView does not keep track of the browsing history for page transitions within frames, which may be a desirable feature.
Hope this answer helps you out
Related
So the case is - when I run my website under Android Chrome, it's all ok, but when I open it up in the default "internet" app, it doesn't render some html markup and js is run only to some extent. I used the Aurelia.js framework for coding it. How can I debug this behavior? Is there a way to somehow see the errors in js console on Androids default internet app?
it depends on a version of android you're testing on
as google says
Since Android 4.4 (KitKat), the WebView component is based on the Chromium open source project. WebViews now include an updated version of the V8 JavaScript engine and support for modern web standards previously missing in old WebViews. New Web views also share the same rendering engine as Chrome for Android, so rendering should be much more consistent between the WebView and Chrome.
https://developer.chrome.com/multidevice/webview/overview
So if you testing on android version before 4.4 you may not test it on chromium based browser
I've struggled to find any reference to web development when it comes to the difference between UIWebView and Safari mobile.
I'be been able to find difference between different browsers, but not between the native iOS web view and Safari mobile.
I am not sure wether you speak about UIWebView or WKWebView. The last one is available since iOS 8.0 (source: WKWebView doc).
The performance of the old WebView component was lower than a Safari webpage because it was unable to use Nitro JavaScript engine (source: old questions on SO, like this one).
However, the performance of UIWebView/WKWebView was improved continuously since 2014 and there is no more major technical differences, at least between WKWebView and a mobile webpage (source here). The differences between UIWebView and WKWebView are explainded in this SO thread.
Keep in mind that Apple's guidelines forbid some use cases of Webview, like external authentification or purchase :
Apps that link to external mechanisms for purchases or subscriptions to be used in the App, such as a "buy" button that goes to a web site to purchase a digital book, will be rejected
Hope it will help !
Since PhoneGap runs an html page in a native app container, I suppose I require some kind of browser to do that.
Which underlying Browser does PhoneGap use on Android? Is it the default installed browser or does phonegap has its own? Or is it Chrome?
Phone Gap (Cordova) currently uses the standard Android WebView which is a stripped down version of a browser (based on a particular version of WebKit).
It can't really be the Chromium-based WebView yet, that was just made available as a component to third party developers only recently in Android 4.4.
And as of April 1st 2014, Android 4.4 (KitKat) constitutes only about 5.3% of all the Android versions (not to mention, this new Chromium-based WebView still seems to be a work in progress, so it will take a while for most third party developers to feel completely comfortable with it).
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
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.
I'm developing an iPad Web App for a client. Unfortunately I don't have an iPad to test the app, so I tried testing it on my iPhone. I entered the following URL in Mobile Safari and it alerted me that the method is undefined:
javascript:alert(Object.defineProperty);
I need to know however if it'll work on the iPad. Additional information about getter/setter support on the iPad is appreciated.
I've only tested 4.3, but it looks like it is supported for JS objects, but not DOM objects... just to be different from IE8 which is the opposite.
If you have access to OSX, I recommend downloading XCode --it comes with a useful iOS emulator for the various devices.
Also, this link might be useful, as it contains a table of ECMAScript 5 features, even though it does not mention the DOM restriction.
http://davidbcalhoun.com/2011/new-mobile-safari-stuff-in-ios5-position-fixed-overflow-scroll-new-input-type-support-web-workers-ecmascript-5