Skip to content

Instantly share code, notes, and snippets.

View rroossyyiidd's full-sized avatar

Muhammad Rosyid rroossyyiidd

View GitHub Profile
@rroossyyiidd
rroossyyiidd / browserDetect.js
Created June 21, 2019 08:47
Javascript detect type browser
// Opera 8.0+
var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
// Firefox 1.0+
var isFirefox = typeof InstallTrigger !== 'undefined';
// Safari 3.0+ "[object HTMLElementConstructor]"
var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification));
// Internet Explorer 6-11