cbox.ele.initial-scale = 1.0 is invalid JavaScript because you can’t have a hyphen (-) in an identifier.
Even if you used correct syntax: cbox.ele['initial-scale'] = '1.0' this would have no effect because you would be setting a property on the HTMLElement which would not do anything meaningful to the DOM, as initial-scale isn’t as supported attribute on the meta tag.
The equivalent p5.js code would set the content attribute of the element in question:
function setup() {
createCanvas(600, 1100);
cbox= select('meta[name=viewport]');
cbox.ele.attribute('content', 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0');
background(0);
}
function draw() {
}
[HTML]
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- PLEASE NO CHANGES BELOW THIS LINE (UNTIL I SAY SO) -->
<script language="javascript" type="text/javascript" src="libraries/p5.min.js"></script>
<script language="javascript" type="text/javascript" src="TEST_SIZE_EXAMPLE.js"></script>
<!-- OK, YOU CAN MAKE CHANGES BELOW THIS LINE AGAIN -->
<!-- This line removes any default padding and style.
You might only need one of these values set. -->
<style> body { padding: 0; margin: 0; } </style>
</head>
<body>
</body>
</html>
I suggest you read this page on MDN for an overview of how this setting is used. If you’re still struggling you should make a separate post outlining the specific layout you are trying to achieve on mobile, and sharing code with your best attempt.
The former uses the default viewport width, and as a result renders the text very small. The later uses device-width (via the p5.js code to dynamically set the veiwport settings) and should show the text zoomed in to a more natural size and scrollable horizontally.
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- PLEASE NO CHANGES BELOW THIS LINE (UNTIL I SAY SO) -->
<script language="javascript" type="text/javascript" src="libraries/p5.min.js"></script>
<script language="javascript" type="text/javascript" src="TEST_ARRAY_TEXT.js"></script>
<!-- OK, YOU CAN MAKE CHANGES BELOW THIS LINE AGAIN -->
<!-- This line removes any default padding and style.
You might only need one of these values set. -->
<style> body { padding: 0; margin: 0; } </style>
</head>
<body>
</body>
</html>
initial-scale=1.0
Even if you change ‘initial-scale=1.0’ and access the site with a smartphone, the displayed screen is the same.