Q:

Disabling viewport attribute for Firefox on Android

For an unknown reason this command creates problems on Firefox for Android. It is located in the header above the javacript copied below and is working on all other mobile systems.
<head>
<meta name="viewport" id="viewport" content="user-scalable=0"/>  <!--320-->

So, in order to disable it for Firefox Android I implemented this javascript (reversing the scalable to =1):
<script>
var is_android = ua.indexOf("android") > -1; 
var is_firefox = ua.indexOf('firefox') > -1;
if(is_firefox && is_android)
{
alert ('pouet'); /// working - I get the alert on Firefox Android only
document.getElementById("viewport").setAttribute("content", "user-scalable=1");
}
</script>
</head>

The reversing process do not work and I wonder why. Thanks for your help.

A:

Here is my workaround, I set up the viewport tag only with this script:
var ua = navigator.userAgent.toLowerCase();
var is_android = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");
var is_firefox = ua.indexOf('firefox') > -1;
if(is_firefox && is_android)
{
// alert ('FF');
document.write('<meta name="viewport" content="user-scalable=1"/><!--320-->');
} else {
// alert ('NoFF');
document.write('<meta name="viewport" content="user-scalable=0"/><!--320-->');
}

