Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make Google Apps Scripts web apps responsive and mobile friendly?

I've been trying for a few days to figure out how I can make the web app from my Google App Script work on mobile. The most common solution I've seen is to simply embed the web app into the old version of Google Sites.

Right now the page resizes fine on desktop browsers but as soon as I open it up on mobile it's all zoomed out way too far.

like image 813
RayB Avatar asked Jul 30 '17 00:07

RayB


People also ask

Do Google scripts work on mobile?

Learn more. Unfortunately, Scripts do not run on mobile devices. The mobile version is not a full-blown version like the one on PCs.


1 Answers

The way to do this is use the addMetaTag method in your to your .gs file.

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

To read more about it look at the documentation here:

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

like image 166
RayB Avatar answered Sep 16 '22 19:09

RayB