iOS8 Simulator user agent - uiwebview

While investigating why I have a bug on iOS8 webview I discovered that WebView's User-Agent is:
Mozilla/5.0 (iPhone; CPU iPhone OS 10_9_5 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A365 (2072607680)
Whereas since I'm running for iOS8, it rather should be:
Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A405kalturaNativeCordovaPlayer (350612576)
Of Course there's no iPhone running version 10.10 as yet, so Xcode6 is somehow picking up version from Mac OS X. For iOS < iOS8 simulators, it works just fine.
So do you have a solution for me how to discover if it's iOS8 simulator or not
For now this is my javascript method:
isIOS8 = function(){
return ( /OS 8_/.test( userAgent ) || /Version\/8/.test( userAgent ) ) && isIOS();
};

This issue was fixed in the iOS 8.3 Simulator Runtime. That version and newer versions do not suffer from this issue any more.
I suggest you look for the "iPhone OS" and "AppleWebKit/600.1.4" substrings if you really need to determine that you're running on iOS 8, but you should probably not be approaching the problem this way. Instead, you're probably better off making a determination based on capabilities rather than version numbers.

Related

Why chrome sends all agent names as part of user-agent header

Is there any reason why chrome browser (71 probably earlier version too) sends all browser names as part of its user agent parameter ?
This is what i see in the console. Is this expected, Will this affect the client information if the server wants to know/log the agent names ?
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
They all have Mozilla in beginning of their Useragent because they follow standard mozilla rendering back in 2000 era. Most browsers share some of each other rendering engines, that's why their useragent often consist of similar values.
Browsers have came a long way to reach their current state. Current user-agents have to do with a little bit of browsers history. When there was a fight between Firefox and Internet Explorer, Chrome appeared. Some websites would ask Firefox users to switch to Internet Explorer for better rendering (because their website was old and not compatible with Firefox) and some would advice Internet Explorer users to switch to Firefox for modern rendering and better performance.
There was some forks of Firefox which also used similar user agent, "Gecko/####" which say this browser is using Gecko engine.
Websites check if a browser have "Gecko" in its user agent and decide to show modern design. Chrome is using Apple WebKit engine to render HTML, but in order to avoid those websites show recommendation for Internet Explorer, added "Like Gecko" to it's useragent.
Now that Chrome is top browser, have a look at Microsoft Edge 14: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14931
As Internet Explorer reputation got very bad, Microsoft could not use any user agent string that could make websites think Edge is Internet Explorer. therefor, by putting Chrome, Safari, AppleWebKit, "Like Gecko" is satisfy websites that are looking for this strings to avoid showing a message to switch to Chrome. Microsoft is using "AppleWebKit" in it's useragent even when they are not using AppleWebKit yet. (They will start using in next versions of Edge)

Detecting “Tablet/Touch Mode” in Edge using JavaScript on Windows 10?

This question was asked before, but the answers are not exactly what I need.
I need to distinguish in Microsoft Edge if it's a tablet or not (Desktop).
1) The following thread:
Can you detect "Tablet Mode" in Edge and IE11 using JavaScript on Windows 10?
worked indeed, but I'm afraid that in the next version Microsoft will change the behavior.
How can I be sure that they won't?
Answers with if condition of window.PointerEvent do not work at all, since it's defined in Desktop.
I can't use CSS Media Queries Interaction media features as suggested here:
Is there any way to detect if user has launched microsoft edge tablet or desktop browser?
Here are the hardware specific differences in the Edge browser capabilities:
The only differences are due to certain device-specific qualities – for example, codec support may be different on phones due to missing hardware acceleration, and Flash is not supported on Windows 10 Mobile. Because Windows 10 Mobile has a different background model, RTC (Real-Time Communications) APIs are also currently not supported. Finally, Windows 10 Mobile does not support Flash in order to provide a modern, touch-focused, and power-efficient experience appropriate for a mobile device. Because of this, Flash is not supported in Microsoft Edge in Continuum.
To detect RTC capabilities, use the following code:
if (RTCRtpCapabilities)
{
initRTC();
}
function initRTC()
{
var recvAudioCaps = RTCRtpReceiver.getCapabilities("audio");
var recvVideoCaps = RTCRtpReceiver.getCapabilities("video");
var sendAudioCaps = RTCRtpSender.getCapabilities("audio");
var sendVideoCaps = RTCRtpSender.getCapabilities("video");
}
Embedding a Flash movie which uses an ExternalInterface call would be the easiest way to detect Flash.
The properties of the navigator object should be able to distinguish tablet from phone. For example:
navigator.cpuClass
should return x86 for Surface devices, but other for phones.
Also, the user agent changes when casting a phone display to a TV. It goes from:
Microsoft Edge UA (Mobile)
Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; Microsoft; <Device>) AppleWebKit/<Rev (KHTML, like Gecko) Chrome/<Rev> Mobile Safari/<Rev> Edge/<Rev>
to:
Microsoft Edge UA (Continuum)
Mozilla/5.0 (Windows NT 10.0; ARM) AppleWebKit/<Rev> (KHTML, like Gecko) Chrome/<Rev> Safari/<Rev> Edge/<Rev>
compared to the desktop:
Microsoft Edge UA (Desktop)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/<Rev> (KHTML, like Gecko) Chrome/<Rev> Safari/<Rev> Edge/<Rev>
References
Microsoft Edge and Continuum: Your desktop browser on Mobile
Microsoft Edge Dev Guide: Object RTC API
ORTC Specification: dictionary RTCRtpCapabilities
Flash Player guidance for Internet Explorer 11 and Microsoft Edge
Minimum Hardware Requirements: Windows 10
Continuum for Phones FAQ
clientInformation object
Device Fingerprint Help
Security Error when trying to call ActionScript function from JS
The Windows 10 Browser Conundrum
how to tell if android user came from home screen app
Configuring Web Applications

Does iOS 8 support IndexedDB with UIWebView?

I see that Safari on iOS 8 has support for IndexedDB, but I can't find anything about UIWebView. From my preliminary testing, it looks like it doesn't, but I'm hoping someone out there has a concrete answer for me.
UIWebView does not support IndexedDB, but WKWebView does.
Here is a post of technologies tested on the various web viewers available on iOS8:
http://mail-archives.apache.org/mod_mbox/cordova-dev/201409.mbox/%3CCAD66QQSYuEhWkW9-b_TN4MK-+MO5MfjU2cMjkhbRvaxCWF51eA#mail.gmail.com%3E
iPod Touch iOS 8 *Safari*
UserAgent - Mozilla/5.0 (iPod touch; CPU iPhone OS 8_0 like Mac OS X)
AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A365
Safari/600.1.4
Sunspider - 1825ms Overall
HMTL5 Test - 440/555
- Seamless iFrame - No
- 2D Graphics Path Support - Yes
- Web GL 3D Graphics - Yes
- IndexedDB - Yes
- Objectstore ArrayBuffer Support - Yes
iPod Touch iOS 8 *HomeScreen*
UserAgent - Mozilla/5.0 (iPod touch; CPU iPhone OS 8_0 like Mac OS X)
AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A365
SunSpider - 1801.0ms Overall
HTML5 Test - 427/555
- Seamless iFrame - No
- 2D Graphics Path Support - Yes
- Web GL 3D Graphics - Yes
- IndexedDB - No
- Objectstore ArrayBuffer Support - No
iPod Touch iOS 8 *WKWebView*
UserAgent - Mozilla/5.0 (iPod touch; CPU iPhone OS 8_0 like Mac OS X)
AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A365
SunSpider - 1822.8ms Overall
HTML5 Test - 438/555
- Seamless iFrame - No
- 2D Graphics Path Support - Yes
- Web GL 3D Graphics - Yes
- IndexedDB - Yes
- Objectstore ArrayBuffer Support - No
iPod Touch iOS 8 *UIWebView*
UserAgent - Mozilla/5.0 (iPod touch; CPU iPhone OS 8_0 like Mac OS X)
AppleWebKit/600.1.4 (KHTML, like Gecko) Mobile/12A365
SunSpider - 7114.6ms Overall
HTML5 Test - 427/555
- Seamless iFrame - No
- 2D Graphics Path Support - Yes
- Web GL 3D Graphics - Yes
- IndexedDB - No
- Objectstore ArrayBuffer Support - No
*iOS 8 Notes*
- Seamless iFrame was removed compared to iOS 7.1.2
- IndexedDB is only supported in Safari & WKWebView App
- Objectstore ArrayBuffer is only supported in Safari & WKWebView App
- UIWebView is ~4x slower then WKWebView for JS (Sunspider results)
- WKWebView cannot load local files (issue for Cordova/Phonegap/Offline
Solutions)
- No UserAgent difference between UIWebView and WKWebView.
From here: http://www.sencha.com/blog/apple-shows-love-for-html5-with-ios-8
◾IndexedDB is not available in iOS 8 “UIWebView” or Home screen apps

How to extract web browser and OS information for Apache access log

I have configured Apache log for give user agent info and i am getting following information,
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36
It mentioned Mozilla, Chrome and Safari as well along with Windows NT OS.
Can some one clarify me how extract specific Browser information and OS info is correct ?
You can use website stat generator programs, like webalizer or any other newer one.
You will see same browser stats:
You need to run webalizer daily.
I hope it helps.

What is the browser engine of the Sogou browser?

Title pretty much says it all. I am developing for a client that serves a large customer base in China, so I need to make sure the site works in local Chinese browsers. I am experiencing issues with Sogou browser (which I'd never even heard about before today). In order to troubleshoot these issues in an environment I am more familiar with, I wanted to see if I could reproduce these issues in another browser which uses the same engine. If only I knew what engine that was…
Update:
As far as I've been able to find out, Sogou is a dual-engine browser. One engine is Webkit and the other supposedly is Trident, specifically the version that's in IE9. This however, does not correspond to what I am seeing, as the page is clearly rendered differently from what it is in IE9. Maybe it's IE9 in quirks mode?
I've seen a couple references to a dual Trident/Webkit engine. Apparently it can do both; Trident might be either their own build, or the most recent version included with Windows. I have IE9 installed but it's behaving like IE7, which came default on my computer. Sogou-based browsers can be detected and offered to switch to the Webkit engine, like in this code example.
From the Trident useragent string:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; InfoPath.3; Media Center PC 6.0; SE 2.X MetaSr 1.0
Now I'm just guessing this means it uses the IE7 standards mode as default when it's rendering webpages. But then again IE doesn't like reporting the same useragent all the time either...
From the Webkit useragent string (looks Sogou-branded):
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.802.30 Safari/535.1 SE 2.X MetaSr 1.0
I was able to change user agents pretty easily here. "高速" translates roughly to "high speed".
I don't know how reliable the information is, but channel9.msdn.com has a page that suggest it is (or will be?) the Webkit engine.
Chinese dual engine browsers have webkit and Trident. They use webkit by default and use Trident for compatibility mode. Apparently there were a lot of issues reguarding IE-centric websites. I think that has largely passed. For instance, Maxthon dropped the Trident engine in version 3+

Resources