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:
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user