열거형을 호출하려면 상위 클래스, 이름, 속성을 호출합니다. 예를 들면
HtmlService.SandboxMode.IFRAME입니다.
NATIVE 및 EMULATED 모드는
2015년 10월 13일에 지원 중단되었으며 현재 모두 서비스가 종료되었습니다. 이제 IFRAME 모드만 지원됩니다.
악성 HTML 또는 JavaScript가 사용자에게 제공되지 않도록 HTML 서비스에서 제공되는 클라이언트 측 코드는 코드에 제한을 적용하는 보안 샌드박스에서 실행됩니다. 이전에는 HtmlOutput.setSandboxMode(mode) 메서드를 통해 스크립트 작성자가 다양한 버전의 샌드박스 중에서 선택할 수 있었지만 이제는 아무런 영향을 미치지 않습니다. 자세한 내용은 HTML 서비스 제한사항 가이드를 참고하세요.
IFRAME 모드는 다른 샌드박스 모드보다 제한사항이 훨씬 적고 가장 빠르게 실행되지만 Internet Explorer 9를 비롯한 일부 이전 브라우저에서는 전혀 작동하지 않습니다. 샌드박스 모드는 google.script.sandbox.mode를 검사하여 클라이언트 측 스크립트에서 읽을 수도 있습니다. 이 속성은 클라이언트의 실제 모드를 반환하며, 요청된 모드가 사용자의 브라우저에서 지원되지 않는 경우 서버에서 요청된 모드와 다를 수 있습니다.
<!-- Read the sandbox mode (in a client-side script). -->
<script>
alert(google.script.sandbox.mode);
</script>
속성
속성
유형
설명
EMULATED
Enum
ECMAScript 3에서 사용할 수 있는 기능만 사용하여 ECMAScript 5 엄격 모드를 에뮬레이션하는 기존 샌드박스 모드입니다. 이 모드는 2014년 2월 이전에 기본값이었습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-08-04(UTC)"],[[["\u003cp\u003eSandboxMode is used for setting the sandbox environment for client-side HtmlService scripts in Google Apps Script.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eIFRAME\u003c/code\u003e is the only supported SandboxMode; \u003ccode\u003eNATIVE\u003c/code\u003e and \u003ccode\u003eEMULATED\u003c/code\u003e are deprecated and sunset.\u003c/p\u003e\n"],["\u003cp\u003eClient-side code in HTML service runs in a security sandbox with restrictions to protect users.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eIFRAME\u003c/code\u003e mode has fewer restrictions and runs faster but might not work in older browsers like Internet Explorer 9.\u003c/p\u003e\n"],["\u003cp\u003eYou can read the actual sandbox mode on the client-side using \u003ccode\u003egoogle.script.sandbox.mode\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]