Skip to content

Commit 836fa8c

Browse files
committed
feat(defaultTheme): fallback userAgent for platform string
Since `navigator.platform` is deprecated and could be removed in the future, fallback to `navigator.userAgent` if prev one does not exists. See also: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform
1 parent 6fa3894 commit 836fa8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tpl/defaultTheme/frontend/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@
347347

348348
var SKIP_TAGS = ['INPUT', 'BUTTON', 'TEXTAREA'];
349349

350-
var PLATFORM = navigator.platform;
350+
var PLATFORM = navigator.platform || navigator.userAgent;
351351
var IS_MAC_PLATFORM = PLATFORM.indexOf('Mac') >= 0 || PLATFORM.indexOf('iPhone') >= 0 || PLATFORM.indexOf('iPad') >= 0 || PLATFORM.indexOf('iPod') >= 0
352352

353353
var lookupKey;

0 commit comments

Comments
 (0)