I can detect iOS 13 on iPhone but in iPad OS 13 navigator.platform
comes as MacIntel. So it is not possible to get iPad identified using below code, but it works perfectly on iPhone.
if (/iP(hone|od|ad)/.test(navigator.platform)) {
var v = (navigator.appVersion).match(/OS (d+)_(d+)_?(d+)?/);
var version = [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)];
return version;
}
When we request for mobile website using the browser on iPad navigator.platform
returns as iPad and works perfectly.
Can anyone suggest a way to identify iPad running on iOS 13 and up using Javascript?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…