Skip to content

Instantly share code, notes, and snippets.

@CodeDotJS
Created March 27, 2016 09:32
Show Gist options
  • Select an option

  • Save CodeDotJS/921cd7e1054866c0ced5 to your computer and use it in GitHub Desktop.

Select an option

Save CodeDotJS/921cd7e1054866c0ced5 to your computer and use it in GitHub Desktop.
var browser = function() {
if (browser.prototype._cachedResult)
return browser.prototype._cachedResult;
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
return (browser.prototype._cachedResult =
isSafari ? 'Safari' :
'');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment