From 11ae8f0ef4dc1edffb497c0ed56e66054f897b20 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Thu, 24 Oct 2019 16:43:07 +0200 Subject: [PATCH] Add comment for browser and platform detection --- core/util/browser.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/util/browser.js b/core/util/browser.js index 8262692c..15548014 100644 --- a/core/util/browser.js +++ b/core/util/browser.js @@ -79,6 +79,13 @@ try { } export const hasScrollbarGutter = _hasScrollbarGutter; +/* + * The functions for detection of platforms and browsers below are exported + * but the use of these should be minimized as much as possible. + * + * It's better to use feature detection than platform detection. + */ + export function isMac() { return navigator && !!(/mac/i).exec(navigator.platform); }