diff --git a/README.md b/README.md index fdaa94f..2ec084b 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Here is the list of props used by the component. |Property |Type |Default |Description | |-----------|-------|----------|--------------| |once |Bool |true |If ```true```, function contained in children prop will be call only once. If ```false```, it will be called on each render. Default ```true``` due to performance reasons | -|children |Object { browserName: function(browserName){ return node; } } | |An object containing functions to handle different browsers. Properties would be called like browsers: ```chrome```, ```firefox```, ```ie```, ```edge```, ```safari```, ```opera```, ```blink```, ```googlebot``` and ```default```. If specified, the component will use the function under the property with the name of the browser, otherwise, it will use ```default```. Each function take the browser name as parameter and must return a node | +|children |Object { browserName: function(browserName){ return node; } } | |An object containing functions to handle different browsers. Properties would be called like browsers: ```chrome```, ```firefox```, ```ie```, ```edge```, ```safari```, ```opera```, ```blink```, ```googlebot```, ```samsung``` and ```default```. If specified, the component will use the function under the property with the name of the browser, otherwise, it will use ```default```. Each function take the browser name as parameter and must return a node | ### Determining the OS diff --git a/src/index.js b/src/index.js index ed8e994..dd96c9c 100644 --- a/src/index.js +++ b/src/index.js @@ -16,6 +16,7 @@ export default class BrowserDetection extends React.Component { const isAndroid = navigator.userAgent.toLowerCase().indexOf('android') !== -1; const isGoogleBot = navigator.userAgent.toLowerCase().indexOf('googlebot') !== -1; + const isSamsungBrowser = navigator.userAgent.toLowerCase().indexOf('samsungbrowser') !== -1; // eslint-disable-next-line const isIE = /*@cc_on!@*/false || !!document.documentMode; const isEdge = !(isIE) && !!window.StyleMedia; @@ -46,6 +47,8 @@ export default class BrowserDetection extends React.Component { browser = 'blink'; } else if (isGoogleBot) { browser = 'googlebot'; + } else if (isSamsungBrowser) { + browser = 'samsung'; } else { browser = 'unknown'; }