Browserinformation über Javascript auslesen

Um im Fehlerfall mehr Informationen (für den Support etc.) zu erhalten, bietet es sich an, einige Informationen aus dem Browser auszulesen und diese in die UI im Fehlerfall (HTTP 500 und/oder HTTP 400) anzuzeigen.

<div id="info"></div>
<script type="text/javascript">
	output = "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
	output+= "<p>Browser Name: " + navigator.appName + "</p>";
	output+= "<p>Browser Version: " + navigator.appVersion + "</p>";
	output+= "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
	output+= "<p>Cookies: " + document.cookie + "</p>";
	output+= "<p>Platform: " + navigator.platform + "</p>";
	output+= "<p>User-agent header: " + navigator.userAgent + "</p>";
	output+= "<p>Referrer: " + top.document.referrer + "</p>";
	output+= "<p>Time: " + new Date().toLocaleString() + "</p>";
	document.getElementById("info").innerHTML=output;
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *