I need some function returning a boolean value to check if the browser is Chrome.
How do I create such functionality?
Check this: How to detect Safari, Chrome, IE, Firefox and Opera browser?
In your case:
var isChrome = (window.chrome.webstore || window.chrome.runtime) && !!window.chrome;