Enum XFrameOptionsMode
XFrameOptionsMode
클라이언트 측 HtmlService
스크립트에 사용할 수 있는 X-Frame-Options
모드를 나타내는 enum입니다. 이러한 값은 HtmlService.XFrameOptionsMode
에서 액세스할 수 있으며 HtmlOutput.setXFrameOptionsMode(mode)
를 호출하여 설정할 수 있습니다.
enum을 호출하려면 상위 클래스, 이름, 속성을 호출합니다. 예를 들면
HtmlService.XFrameOptionsMode.ALLOWALL
입니다.
XFrameOptionsMode.ALLOWALL
를 설정하면 모든 사이트에서 페이지를 iframe할 수 있으므로 개발자는 클릭재킹에 대한 자체 보호 기능을 구현해야 합니다.
스크립트에서 X-Frame-Options
모드를 설정하지 않으면 Apps Script는 DEFAULT
모드를 기본값으로 사용합니다.
// Serve HTML with no X-Frame-Options header (in Apps Script server-side code).
const output = HtmlService.createHtmlOutput('<b>Hello, world!</b>');
output.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
속성
속성 | 유형 | 설명 |
ALLOWALL | Enum | X-Frame-Options 헤더가 설정되지 않습니다. 이렇게 하면 모든 사이트에서 페이지를 iframe할 수 있으므로 개발자는 클릭재킹에 대한 자체 보호를 구현해야 합니다. |
DEFAULT | Enum | 일반 보안 가정을 유지하는 X-Frame-Options 헤더의 기본값을 설정합니다. 스크립트에서 X-Frame-Options 모드를 설정하지 않으면 Apps Script는 이 모드를 기본값으로 사용합니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-12-22(UTC)
[null,null,["최종 업데이트: 2024-12-22(UTC)"],[[["`XFrameOptionsMode` is used to control how a client-side Apps Script HTML service can be embedded in iframes by other websites."],["`ALLOWALL` permits any website to embed the page in an iframe while `DEFAULT` preserves the standard security behavior."],["If you select `ALLOWALL`, ensure to incorporate your own security measures against clickjacking."],["By default, if `X-Frame-Options` mode isn't specifically set, Apps Script automatically applies the `DEFAULT` mode."]]],["`XFrameOptionsMode` is an enum for setting `X-Frame-Options` in client-side HtmlService scripts. Accessed via `HtmlService.XFrameOptionsMode`, it's set using `HtmlOutput.setXFrameOptionsMode(mode)`. `ALLOWALL` removes the `X-Frame-Options` header, enabling any site to iframe the page, necessitating developer-implemented clickjacking protection. `DEFAULT` is the default mode if no mode is specified. The example shows how to set the mode to `ALLOWALL`.\n"]]