Enum XFrameOptionsMode
XFrameOptionsMode
クライアントサイドの HtmlService
スクリプトで使用できる X-Frame-Options
モードを表す列挙型。これらの値には HtmlService.XFrameOptionsMode
からアクセスでき、HtmlOutput.setXFrameOptionsMode(mode)
を呼び出して設定できます。
列挙型を呼び出すには、その親クラス、名前、プロパティを呼び出します。たとえば、
HtmlService.XFrameOptionsMode.ALLOWALL
です。
XFrameOptionsMode.ALLOWALL
を設定すると、どのサイトでもページを iframe できるため、デベロッパーはクリックジャッキングに対する独自の保護を実装する必要があります。
スクリプトで X-Frame-Options
モードが設定されていない場合、デフォルトで 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 はこのモードをデフォルトとして使用します。 |
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は 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"]]