Skip to content

Instantly share code, notes, and snippets.

@inaz2
Created December 15, 2015 06:24
Show Gist options
  • Save inaz2/df1e987b6f0bf8202908 to your computer and use it in GitHub Desktop.
Save inaz2/df1e987b6f0bf8202908 to your computer and use it in GitHub Desktop.
Check browser user-agent and enabled plugins
<!DOCTYPE html>
<title>Browser Info</title>
<body>
<script>
(function(){
function $E(tagName, textContent){
var elem = document.createElement(tagName);
elem.textContent = textContent;
return elem;
}
document.body.appendChild($E("p", navigator.userAgent));
var ul = $E("ul");
Array.prototype.forEach.call(navigator.plugins, function(v){
ul.appendChild($E("li", v.name + " (" + v.version + ")"));
});
document.body.appendChild(ul);
})();
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment