зеркало из https://github.com/mozilla/gecko-dev.git
bug 124242 r=timeless sr=alecf a=asa
about.html doesn't handle empty useragent
This commit is contained in:
Родитель
be8b7c7b47
Коммит
a27ac8f7c4
|
@ -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>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче