برای فراخوانی یک enum، کلاس والد، نام و ویژگی آن را فراخوانی می کنید. برای مثال، HtmlService.XFrameOptionsMode.ALLOWALL .
تنظیم XFrameOptionsMode.ALLOWALL به هر سایتی اجازه میدهد صفحه را فریم کند، بنابراین توسعهدهنده باید حفاظت خود را در برابر کلیک جک اجرا کند.
اگر یک اسکریپت حالت X-Frame-Options را تنظیم نکند، Apps Script از حالت DEFAULT به عنوان پیش فرض استفاده می کند.
// Serve HTML with no X-Frame-Options header (in Apps Script server-side code).constoutput=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 از این حالت به عنوان پیش فرض استفاده می کند.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003e\u003ccode\u003eXFrameOptionsMode\u003c/code\u003e is used to control how a client-side Apps Script HTML service can be embedded in iframes by other websites.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eALLOWALL\u003c/code\u003e permits any website to embed the page in an iframe while \u003ccode\u003eDEFAULT\u003c/code\u003e preserves the standard security behavior.\u003c/p\u003e\n"],["\u003cp\u003eIf you select \u003ccode\u003eALLOWALL\u003c/code\u003e, ensure to incorporate your own security measures against clickjacking.\u003c/p\u003e\n"],["\u003cp\u003eBy default, if \u003ccode\u003eX-Frame-Options\u003c/code\u003e mode isn't specifically set, Apps Script automatically applies the \u003ccode\u003eDEFAULT\u003c/code\u003e mode.\u003c/p\u003e\n"]]],["`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"],null,[]]