1

I am working mobile responsibility website. I am using own app for show my website.

how to check user open website Using my app or other app (Like : chrome , firefox).

Nagama Inamdar
  • 2,851
  • 22
  • 39
  • 48
Arun Kumar
  • 1,607
  • 1
  • 18
  • 33

1 Answers1

2

Assuming you might want to detect the user agent by ducktyping for web browser detection. This can be done using Javascript.

Update :

var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
    // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
var isFirefox = typeof InstallTrigger !== 'undefined';   
    // Firefox 1.0+
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
    // At least Safari 3+: "[object HTMLElementConstructor]"
var isChrome = !!window.chrome && !isOpera;              // Chrome 1+
var isIE = /*@cc_on!@*/false || !!document.documentMode;   // At least IE6

var output;
output += 'isFirefox: ' + isFirefox + '\n';
output += 'isChrome: ' + isChrome + '\n';
output += 'isSafari: ' + isSafari + '\n';
output += 'isOpera: ' + isOpera + '\n';
output += 'isIE: ' + isIE + '\n';
console.log(output);

Here is the reference link of the answer provided by Rob W.

Community
  • 1
  • 1
Nagama Inamdar
  • 2,851
  • 22
  • 39
  • 48
  • 1
    Trying Useragent but it returns `Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36` – Arun Kumar Sep 02 '15 at 12:01
  • Ok. Updating the answer. You might want look for ducktyping for web browser detection. – Nagama Inamdar Sep 02 '15 at 12:51