зеркало из https://github.com/mozilla/bedrock.git
Identify iPadOS as iOS and not macOS (Fixes #7299)
This commit is contained in:
Родитель
20564c2e01
Коммит
97e0751d35
|
@ -52,7 +52,8 @@
|
|||
}
|
||||
if (pf.indexOf('iPhone') !== -1 ||
|
||||
pf.indexOf('iPad') !== -1 ||
|
||||
pf.indexOf('iPod') !== -1 ) {
|
||||
pf.indexOf('iPod') !== -1 ||
|
||||
pf.indexOf('MacIntel') !== -1 && 'standalone' in navigator) {
|
||||
return 'ios';
|
||||
}
|
||||
if (ua.indexOf('Mac OS X') !== -1) {
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
* Sinon docs: http://sinonjs.org/docs/
|
||||
*/
|
||||
|
||||
/* global sinon */
|
||||
|
||||
describe('site.js', function () {
|
||||
|
||||
'use strict';
|
||||
|
@ -54,6 +56,11 @@ describe('site.js', function () {
|
|||
expect(window.site.getPlatform('foo', 'iPhone Simulator')).toBe('ios');
|
||||
});
|
||||
|
||||
it('should identify iPadOS', function () {
|
||||
window.navigator.standalone = sinon.stub();
|
||||
expect(window.site.getPlatform('foo', 'MacIntel')).toBe('ios');
|
||||
});
|
||||
|
||||
it('should identify OSX', function () {
|
||||
expect(window.site.getPlatform('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0', 'foo')).toBe('osx');
|
||||
expect(window.site.getPlatform('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit/538.10.3 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1', 'foo')).toBe('osx');
|
||||
|
|
Загрузка…
Ссылка в новой задаче