Skip to content

Commit 572622a

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 4269c23 commit 572622a

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
@@ -337,7 +337,7 @@
337337

338338
var SKIP_TAGS = ['INPUT', 'BUTTON', 'TEXTAREA'];
339339

340-
var PLATFORM = navigator.platform;
340+
var PLATFORM = navigator.platform || navigator.userAgent;
341341
var IS_MAC_PLATFORM = PLATFORM.indexOf('Mac') >= 0 || PLATFORM.indexOf('iPhone') >= 0 || PLATFORM.indexOf('iPad') >= 0 || PLATFORM.indexOf('iPod') >= 0
342342

343343
var lookupKey;

0 commit comments

Comments
 (0)