Using responsive meta tags for an apps script webapp
To display a responsive webapp on different devices you can use the addMetaTag
method
Snippet
- See full code
- Leave a comment
- Create script from the snippet *See how to use scrviz for clone Apps Script project
/* exported doGet */
/**
* Using responsive meta tags for the webapp
*/
function doGet() {
const htmlContent = 'Hello world!';
return HtmlService.createHtmlOutput(htmlContent).addMetaTag(
'viewport',
'width=device-width, initial-scale=1'
);
}
Run it
For custom run you need to deploy a webapp with the current doGet
function.
Manifest
appsscript.json{
"webapp": {
"executeAs": "USER_DEPLOYING",
"access": "ANYONE_ANONYMOUS"
},
"runtimeVersion": "V8"
}