After a lot of research, i finally found how to set the initial scale of a webpage using javascript for example in Chrome DevTools. The code should be like this:
document.getElementById("viewport").setAttribute("content", "initial-scale=0.5, user-scalable=yes");
But, I´m always getting error: Uncaught TypeError: Cannot read property 'setAttribute' of null(…)
I tried this on different pages. Is there someting that has changed? I found this method in different posts.
The error message indicates that there is no element with an id of "viewport"
on the page. You may be looking to modify the attributes on the viewport meta tag instead, in which case this answer describes the right approach using JavaScript.