I'm creating a Google Site with Google Apps Script "Enum Sandbox Iframe mode".
In Google Developer Docs, It says, to call a custom function, we need to use google.script.run
Sample:
Code.gs
function doGet() { return HtmlService.createHtmlOutputFromFile('index') .setSandboxMode(HtmlService.SandboxMode.IFRAME); } function doSomething() { Logger.log('I was called!'); }
index.html
<script> google.script.run.doSomething(); </script>
When I run this using Google Chrome, Its working perfect. But it throws an error in Mozilla Firefox. ReferenceError: google is not defined
.
Does anyone know the reason behind it? Any help would be appreciated.
Update:
Filed a bug in Google Code : https://code.google.com/p/google-apps-script-issues/issues/detail?id=4652&thanks=4652&ts=1419836713&