Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mobile device zoom in Google Apps Script

I've made a web app in GAS which is 400 pixels wide. I'd like this to zoom to fill the screen of a mobile device when loaded, rather than only filling half the screen (still using a fixed pixel width though).

I've tried using the viewport code below with no luck.

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes" />
like image 567
T-L Avatar asked Jan 27 '13 08:01

T-L


1 Answers

This was address by Google in recent months and functionality was added, use the .addMetaTag() method.

Example:

<meta name="google-site-verification" content="..."/>
<meta name="viewport" content="..."/>

var output = HtmlService.createHtmlOutput('<b>Hello, world!</b>');
output.addMetaTag('viewport', 'width=device-width, initial-scale=1');

Documentation on the method https://developers.google.com/apps-script/reference/html/html-output#addmetatagname-content

Related Forum https://code.google.com/p/google-apps-script-issues/issues/detail?id=4659

like image 130
Partik Avatar answered Oct 06 '22 22:10

Partik