Google Apps Script snippets ᕦʕ •ᴥ•ʔᕤ

Using responsive meta tags for an apps script webapp

Snippet of Using responsive meta tags for an apps script webapp

To display a responsive webapp on different devices you can use the addMetaTag method

Snippet

index.js
/* 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"
}

#webapp