This page looks best with JavaScript enabled

How to add custom domain on Google App Scipt

 ·   ·  β˜• 1 min read

It may have occurred to you that when deploying a Google Apps Script web app, the URL spewn forth looks rather long and unattractive:*mashes keyboard*/exec

And that it would be a lot nicer to have something more clear like

It turns out that the solution to hosting Google Apps Script web apps on custom domains has been under our noses for all this time. The secret sauce lies in the setXFrameOptionsMode method in the HtmlService class. It takes an enum of one of two values: DEFAULTor ALLOWALL. What we want to do is to set this to ALLOWALL.

return HtmlService  

This now means that we are at liberty to embed our app into any page using an iframe. It even supports SSL.

<iframe src="**\*mashes keyboard\***/exec"></iframe>

And the end result is something quite stunning.

Ohidur Rahman Bappy
Ohidur Rahman Bappy
πŸ“šLearner 🐍 Developer