iOS UIWebView not 100% compatible with Safari on iOS? - javascript

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.

Related

Android internet app doesn't render mobile website version properly

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

Is there any diferences between UIWebview and mobile Safari in rendering pages?

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

Which underlying Browser does PhoneGap use on Android?

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).

Is it possible with Weinre to set javascript breakpoints when debugging iOS webviews

I'm using weinre to debug a phonegap application. However it doesn't seem possible to step through the JS or set breakpoints. Is this at all possible?
No, it is not possible to set breakpoints with weinre.
No is the correct answer. And the "secret XCode UIWebView" mentioned in the other answer doesn't work any more. BUT ...
You can now throw the Weinre out the window because, with the release of iOS 6, Apple released remote mobile Web Inspector for Safari, and this is HUGE for anyone who's been struggling to debug their iOS mobile apps. Basically you have all the features and power of regular Safari Web Inspector--including Breakpoints--for your mobile apps, including WebView & Phonegap apps. I've used weinre quite a bit, and this makes it completely obsolete for these purposes, since the new remote Web Inspector is a full-featured, native debugger.
Here's how it works (requires a Mac, xCode 4.5+ running an iOS 6 simulator (or an attached iOS 6 device, I think), and Safari 6+ on your Mac:
In your ios6 simulator/device, Settings --> Safari --> Advanced --> Web Inspector --> On (this is On by default in the simulator).
In Safari, access iPhone/iPad Simulator from the Develop menu and see your page. You can enable the Develop menu in Safari's Advanced Preferences if you don't see it.
More discussion at the bottom of: http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers
even if this an old question, maybe someone is still struggling with iOS debugging from windows (as i was until today...:D).
I found this quite good solution:
https://www.genuitec.com/products/gapdebug/
You can install apps from ipa and debug all the code usually obfuscated by Safari.

Are JavaScript getters/setters supported by Mobile Safari on the iPad?

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

Categories

Resources