My web page has no «meta» viewport tag absolutely.
I have created my own «meta» viewport tag dynamically:
var viewportMeta = document.createElement('meta');
viewportMeta.setAttribute('id', 'myMeta');
viewportMeta.setAttribute('name', 'viewport');
viewportMeta.setAttribute('content', 'width=device-width, initial-scale=1.0, user-scalable=no');
and appended it to the «head» (after some user actions):
document.head.appendChild(viewportMeta);
Then (after user clicks on some button) I need to remove "myMeta" «meta» tag from «head»:
var myMeta = document.getElementById('myMeta');
document.head.removeChild(myMeta);
And it removes, 100%! Checked with desktop browser and with Adobe Edge Inspect Weinre on iPad.
But the whole page does not go to it's previous state! Whole page stays the same, like it has «meta» viewport tag with all defined properties in "viewportMeta" object.
So, is there a way to remove «meta» viewport tag completely? Any ideas?
(This issue is on iPad's Safari and Chrome browsers. Tried not to remove «meta» tag but just changed it's «content» property — no success. Did not checked on Android devices and browsers.)