Is there a way to use a specific cname to run a Htmlservice webapp ? I would like to user something like app.domain.com to run the htmlservice app.
I see that this works inside a Google Site but the Google site doesn't manage correctly the tags
Not possible. At most you can use your custom url and program it to redirect to your apps script webapp. That way its easy to type and remember.
The solution posted by @Karl_S works with the published /exec urls but not with the /dev ones. Furthermore the responsive design is lost because the frame redirect skips the viewport setting in the html wrapper. An alternative would be to host the wrapping html page on your domain and add the viewport setting in the head while keeping the rest what the frame redirect does. For example the following worked for me:
<html><head>
<title>My App</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<frameset rows="100%">
<frame src="https://script.google.com/a/.../exec"
title="My App"
frameborder="0"
noresize="noresize">
</frameset>
</html>
Also make sure to publish your script with cross domain restriction disabled, i.e. In your script ensure you call
HtmlService.createTemplateFromFile(...)
.evaluate()
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
Hope it helps someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With