JSFiddle - React, Tailwind, and code Playground

by Minko Gechev

HTML

<div id="chromeBox">
It's not Chrome!
</div>

CSS

#chromeBox {
  width: 100px;
  height: 100px;
  background: #ccc;
  position: absolute;
}

JavaScript

function browserTest() {
    var browser = /Chrome[\/\s](\d+\.\d+)/.test(navigator.userAgent);
    if (browser) {
        document.getElementById("chromeBox").style.visibility = "hidden";
        //alert("chrome");
    }
    else {
        document.getElementById('chromeBox').style.visibility = 'visible';
        //alert("not chrome");
    }
}
browserTest();