Enum XFrameOptionsMode
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
XFrameOptionsMode X-Frame-Options
মোডের প্রতিনিধিত্বকারী একটি enum যা ক্লায়েন্ট-সাইড Html Service
স্ক্রিপ্টের জন্য ব্যবহার করা যেতে পারে। এই মানগুলি Html Service.XFrameOptionsMode
থেকে অ্যাক্সেস করা যেতে পারে এবং Html Output.setXFrameOptionsMode(mode)
কল করে সেট করা যেতে পারে।
একটি enum কল করার জন্য, আপনি তার পিতামাতার শ্রেণী, নাম এবং সম্পত্তি কল করুন। উদাহরণস্বরূপ, HtmlService.XFrameOptionsMode.ALLOWALL
।
XFrameOptionsMode.ALLOWALL
সেট করা যেকোনো সাইটকে পৃষ্ঠা আইফ্রেম করতে দেয়, তাই বিকাশকারীকে ক্লিকজ্যাকিংয়ের বিরুদ্ধে তাদের নিজস্ব সুরক্ষা প্রয়োগ করা উচিত।
যদি একটি স্ক্রিপ্ট একটি 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 হেডার সেট করা হবে না। এটি যেকোনো সাইটকে পৃষ্ঠা আইফ্রেম করতে দেয়, তাই বিকাশকারীকে ক্লিকজ্যাকিংয়ের বিরুদ্ধে তাদের নিজস্ব সুরক্ষা প্রয়োগ করা উচিত। |
DEFAULT | Enum | X-Frame-Options হেডারের জন্য ডিফল্ট মান সেট করে, যা স্বাভাবিক নিরাপত্তা অনুমান সংরক্ষণ করে। যদি একটি স্ক্রিপ্ট একটি X-Frame-Options মোড সেট না করে, অ্যাপস স্ক্রিপ্ট ডিফল্ট হিসাবে এই মোড ব্যবহার করে। |
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\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,["# Enum XFrameOptionsMode\n\nXFrameOptionsMode\n\nAn enum representing the `X-Frame-Options` modes that can be used for client-side [HtmlService](/apps-script/reference/html/html-service) scripts. These values can be accessed from [HtmlService.XFrameOptionsMode](/apps-script/reference/html/html-service#XFrameOptionsMode),\nand set by calling [HtmlOutput.setXFrameOptionsMode(mode)](/apps-script/reference/html/html-output#setXFrameOptionsMode(XFrameOptionsMode)).\n\nTo call an enum, you call its parent class, name, and property. For example, `\nHtmlService.XFrameOptionsMode.ALLOWALL`.\n\nSetting `XFrameOptionsMode.ALLOWALL` will let any site iframe the page, so the developer\nshould implement their own protection against clickjacking.\n\nIf a script does not set an `X-Frame-Options` mode, Apps Script uses `DEFAULT`\nmode as the default.\n\n```javascript\n// Serve HTML with no X-Frame-Options header (in Apps Script server-side code).\nconst output = HtmlService.createHtmlOutput('\u003cb\u003eHello, world!\u003c/b\u003e');\noutput.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);\n``` \n\n### Properties\n\n| Property | Type | Description |\n|------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `ALLOWALL` | `Enum` | No `X-Frame-Options` header will be set. This will let any site iframe the page, so the developer should implement their own protection against clickjacking. |\n| `DEFAULT` | `Enum` | Sets the default value for the `X-Frame-Options` header, which preserves normal security assumptions. If a script does not set an `X-Frame-Options` mode, Apps Script uses this mode as the default. |"]]