user1836719
user1836719

Reputation: 81

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?

Upvotes: 8

Views: 691

Answers (1)

Mogsdad
Mogsdad

Reputation: 45710

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.

Upvotes: 5

Related Questions