![]() 'Internet Explorer 9 ', 'Mozilla/5.0 (compatible MSIE 9.0 Windows NT 6.1 Trident/5.0)', ![]() 'Internet Explorer 10 ', 'Mozilla/5.0 (compatible MSIE 10.0 Windows NT 6.1 WOW64 Trident/6.0)', 'Internet Explorer 11 ', 'Mozilla/5.0 (Windows NT 10.0 WOW64 Trident/7.0 rv:11.0) like Gecko', 'Googlebot Smartphone ', 'Mozilla/5.0 (Linux Android 6.0.1 Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36 (compatible Googlebot/2.1 +)', 'Googlebot Desktop ', 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko compatible Googlebot/2.1 +) Chrome/%s Safari/537.36', 'Googlebot ', 'Mozilla/5.0 (compatible Googlebot/2.1 +)', 'Firefox - iPad ', 'Mozilla/5.0 (iPad CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4', ![]() 'Firefox - iPhone ', 'Mozilla/5.0 (iPhone CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4', 'Chomre - Mac ', 'Mozilla/5.0 (Macintosh Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36', 'Chrome - iPad ', 'Mozilla/5.0 (iPad CPU OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/%s Mobile/15E148 Safari/604.1', 'Chrome - iPhone ', 'Mozilla/5.0 (iPhone CPU iPhone OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/%s Mobile/15E148 Safari/604.1', 'Chrome - Android Tablet ', 'Mozilla/5.0 (Linux Android 4.3 Nexus 7 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36', 'Chrome - Android Mobile (high-end) ', 'Mozilla/5.0 (Linux Android 10 Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36', 'Chrome - Android Mobile ', 'Mozilla/5.0 (Linux Android 6.0 Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36', 'BlackBerry - BB10 ', 'Mozilla/5.0 (BB10 Touch) AppleWebKit/537.1+ (KHTML, like Gecko) Version/10. 'Android 2.3 Browser ', 'Mozilla/5.0 (Linux U Android 2.3.6 en-us Nexus S Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1', 'Android 4.0.2 Browser ', 'Mozilla/5.0 (Linux U Android 4.0.2 en-us Galaxy Nexus Build/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', Return platformExpression.test(agent) & expectedExpression.test(agent) Īpple Safar web browser was released last time on Windows in 2012, that makes why we do not consider other platforms in the above logic. ONLINE-RUNNER:browser Ĭonst platformExpression = /Mac|iPhone|iPod|iPad/i Ĭonst rejectedExpression = /Chrome|Android|CriOS|FxiOS|EdgiOS/i In this solution, we test only user agent to detect web browser. User-Agent can be changed by advanced user that makes lead to some errors - if it may be your case, check alternative solution too. SafariExpression.test(erAgent) Ĭonsole.log('You are on Apple Safari web browser.') Ĭonsole.log('You are not on Apple Safari web browser.') ![]() Return appleExpression.test(navigator.vendor) & Quick solution: // ONLINE-RUNNER:browser In this short article, we would like to show how using JavaScript, detect Apple Safari web browser on Apple devices.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |