我有一个Javascript代码,我检测我的网站是否是从移动设备上查看的.以下是我的代码:
(function() {
if (navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPad/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)
|| navigator.userAgent.match(/Opera Mini/i)
|| navigator.userAgent.match(/IEMobile/i)
) {
isMobile = true;
}
})();
Run Code Online (Sandbox Code Playgroud)
此代码是否涵盖所有可能的情况,或者某些设备是否有可能绕过此检查?