Skip to content

Instantly share code, notes, and snippets.

View VARGA-Peter's full-sized avatar

Peter VARGA VARGA-Peter

View GitHub Profile
@VARGA-Peter
VARGA-Peter / checkVersion.js
Last active May 1, 2021 14:16 — forked from ngoclt/checkVersion.js
Check iOS version with Javascript
/**
* Returns the iOS version as string. For example 14.4.2 or 13.2.3.
* If the browser is not running under iOS "undefined" is returned.
*/
function iOsGetVersion()
{
const agentName = window.navigator.userAgent;
const matchingArray = agentName.match(/(iPhone|iPad).+ ([0-9_]+) .+/);
if( matchingArray ) {