bug 124242 r=timeless sr=alecf a=asa

about.html doesn't handle empty useragent


git-svn-id: svn://10.0.0.236/trunk@117690 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cbiesinger%web.de
2002-03-28 21:17:18 +00:00
parent b1f6ffacaf
commit 476da25542
2 changed files with 12 additions and 4 deletions

View File

@@ -71,8 +71,12 @@ h1 {
<a id="mozlink" href="http://www.mozilla.org/releases/">Mozilla </a>
</h1>
<script type="application/x-javascript">
document.getElementById("mozlink").firstChild.appendData(navigator.userAgent.match(/rv:([^;)]+)/)[1]);
document.getElementById("mozver").appendChild(document.createTextNode(navigator.userAgent));
// using try..catch to handle empty useragents and other cases where the regex fails to apply
try {
document.getElementById("mozver").appendChild(document.createTextNode(navigator.userAgent));
document.getElementById("mozlink").firstChild.appendData(navigator.userAgent.match(/rv:([^;)]+)/)[1]);
}
catch (e) {}
</script>
</td>

View File

@@ -71,8 +71,12 @@ h1 {
<a id="mozlink" href="http://www.mozilla.org/releases/">Mozilla </a>
</h1>
<script type="application/x-javascript">
document.getElementById("mozlink").firstChild.appendData(navigator.userAgent.match(/rv:([^;)]+)/)[1]);
document.getElementById("mozver").appendChild(document.createTextNode(navigator.userAgent));
// using try..catch to handle empty useragents and other cases where the regex fails to apply
try {
document.getElementById("mozver").appendChild(document.createTextNode(navigator.userAgent));
document.getElementById("mozlink").firstChild.appendData(navigator.userAgent.match(/rv:([^;)]+)/)[1]);
}
catch (e) {}
</script>
</td>