Template:Browser Detection: Difference between revisions

From Donate
Jump to navigation Jump to search
Content deleted Content added
Seddon (WMF) (talk | contribs)
Created page with "<html><script>$(function () { //Check if browser is Chrome else if (navigator.userAgent.search("Chrome") & gt; = 0) { console.log('This is a Chrome Browser')..."
 
Seddon (WMF) (talk | contribs)
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1:
<html>
<script>
$(function () {
//Check if browser is Chrome
else if (navigator.userAgent.search("Chrome") & gt; >= 0) {
console.log('This is a Chrome Browser')
}
//Check if browser is Firefox
else if (navigator.userAgent.search("Firefox") & gt; >= 0) {
console.log('This is a Firefox Browser')
}
//Check if browser is Safari
else if (navigator.userAgent.search("Safari") & gt; >= 0 & amp; & amp; navigator.userAgent.search("Chrome") & lt;< 0) {
console.log('This is a Safari Browser')
}
});
</script>
</html>

Latest revision as of 20:51, 11 January 2020