Add comment for browser and platform detection

This commit is contained in:
Samuel Mannehed 2019-10-24 16:43:07 +02:00
parent c32d4f3cd0
commit 11ae8f0ef4
1 changed files with 7 additions and 0 deletions

View File

@ -79,6 +79,13 @@ try {
} }
export const hasScrollbarGutter = _hasScrollbarGutter; 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() { export function isMac() {
return navigator && !!(/mac/i).exec(navigator.platform); return navigator && !!(/mac/i).exec(navigator.platform);
} }