Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modify html Meta when using google app script ui service

Is there anyway to add meta tags to html header when creating a web app using the ui service on Google app scripts?

like image 682
user1836719 Avatar asked Nov 19 '12 18:11

user1836719


People also ask

How do I run a HTML file in Google App Script?

To add an HTML file to your Apps Script project, open the Script Editor and choose File > New > HTML File. Within the HTML file, you can write most standard HTML, CSS, and client-side JavaScript. The page will be served as HTML5, although some advanced features of HTML5 are not available, as explained in Restrictions.

Can I use JavaScript in Google App Script?

Google Apps Script is a rapid application development platform that makes it fast and easy to create business applications that integrate with Google Workspace. You write code in modern JavaScript and have access to built-in libraries for favorite Google Workspace applications like Gmail, Calendar, Drive, and more.

Can I use jQuery in Google App Script?

Google Apps Script allows us to use jQuery, which is the preferred technique in HTML programing to date.

Is Google Apps Script asynchronous?

google. script. run is an asynchronous client-side JavaScript API available in HTML-service pages that can call server-side Apps Script functions. To interact with dialogs or sidebars in Google Docs, Sheets, or Forms from client-side code, use google.


1 Answers

Quoting from Caja Issue 1632, Meta tag defining viewport not rendered:

Caja is designed to provide guest content a portion of a page, somewhat like an iframe. Therefore, as a general rule, it cannot make declarations which affect the display of the entire page. In order to have this feature you would have to have the host page explicitly permit it in some way.

Since Google uses Caja sanitization for UI and HTML service pages, and wraps the sanitized output as a <div> within its own host page, Google Apps Script would need to explicitly permit setting of the meta tags.

Unfortunately, that isn't supported in the Google Apps Script APIs.

like image 92
Mogsdad Avatar answered Oct 20 '22 08:10

Mogsdad