Wenn Sie ein Enum aufrufen möchten, rufen Sie die übergeordnete Klasse, den Namen und die Eigenschaft auf. Beispiel:
HtmlService.XFrameOptionsMode.ALLOWALL.
Wenn Sie XFrameOptionsMode.ALLOWALL festlegen, kann jede Website die Seite in einem Iframe einbetten. Der Entwickler sollte daher seinen eigenen Schutz vor Clickjacking implementieren.
Wenn in einem Script kein X-Frame-Options-Modus festgelegt ist, verwendet Apps Script standardmäßig den DEFAULT-Modus.
// 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);
Attribute
Attribut
Typ
Beschreibung
ALLOWALL
Enum
Es wird kein X-Frame-Options-Header festgelegt. Dadurch kann jede Website die Seite in einem IFrame einbetten. Der Entwickler sollte daher seinen eigenen Schutz vor Clickjacking implementieren.
DEFAULT
Enum
Legt den Standardwert für den X-Frame-Options-Header fest, wodurch die normalen Sicherheitsannahmen beibehalten werden. Wenn in einem Script kein X-Frame-Options-Modus festgelegt ist, verwendet Apps Script diesen Modus als Standard.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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"]]