2014-12-29 4 views
1

Google Apps Script "Enum Sandbox Iframe 모드"로 Google 사이트를 만들고 있습니다.ReferenceError : google이 정의되지 않았습니다 - Mozilla Firefox에서 Google Apps 스크립트 오류가 발생했습니다

Code.gs

 
function doGet() { 
    return HtmlService.createHtmlOutputFromFile('index') 
     .setSandboxMode(HtmlService.SandboxMode.IFRAME); 
} 

function doSomething() { 
    Logger.log('I was called!'); 
} 

index.html을 : Google Developer Docs에서

, 그것은 말한다, 사용자 정의 함수를 호출하기 위해, 우리는 google.script.run

샘플을 사용할 필요가

 
<script> 
    google.script.run.doSomething(); 
</script> 

Google 크롬을 사용하여 이것을 실행할 때 완벽합니다. 그러나 Mozilla Firefox에서는 오류가 발생합니다. ReferenceError: google is not defined.

누군가 그 이유를 알고 있습니까? 어떤 도움을 주시면 감사하겠습니다.

업데이트 :

구글 코드에서 버그를 출원 : https://code.google.com/p/google-apps-script-issues/issues/detail?id=4652&thanks=4652&ts=1419836713&

답변

3

IFRAME 모드가 지원되지 않는 모든 브라우저에서

This mode imposes many fewer restrictions than the other sandbox modes and runs fastest, but does not work at all in certain older browsers, including Internet Explorer 9

https://developers.google.com/apps-script/reference/html/sandbox-mode

당신은 에뮬레이션으로 전환해야 또는 네이티브. IFRAME 모드가 새롭습니다. 시간이 지남에 따라 더 많은 지원이 제공 될 것입니다.

function doGet() { 
    return HtmlService.createHtmlOutputFromFile('index') 
     .setSandboxMode(HtmlService.SandboxMode.NATIVE); 
} 
+0

이제 완벽하게 작동했습니다. 더 많은 브라우저 지원을 위해 Google에서 업데이트를 기다릴 것입니다. –