সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
ব্যবহারকারীদের দূষিত HTML বা JavaScript পরিবেশন করা থেকে রক্ষা করতে, Apps Script স্যান্ডবক্স HTML-পরিষেবা ওয়েব অ্যাপ বা Google ডক্স, পত্রক এবং ফর্মের জন্য কাস্টম ব্যবহারকারী ইন্টারফেসে iframes ব্যবহার করে। (HTML পরিষেবা অন্যান্য পরিস্থিতিতে একটি স্যান্ডবক্স ব্যবহার করে না, যেমন একটি ইমেলের বডি তৈরি করা।) স্যান্ডবক্স ক্লায়েন্ট-সাইড কোডের উপর সীমাবদ্ধতা আরোপ করে।
স্যান্ডবক্স মোড
IFRAME বাদে সমস্ত স্যান্ডবক্স মোড এখন সূর্যাস্ত। পুরানো স্যান্ডবক্স মোড ব্যবহার করা অ্যাপগুলি এখন স্বয়ংক্রিয়ভাবে নতুন IFRAME মোড ব্যবহার করে৷ আপনার যদি পুরানো মোডগুলি ব্যবহার করে তৈরি করা স্ক্রিপ্টগুলি থাকে ( NATIVE এবং EMULATED ), তাহলে আপনার উচিত মাইগ্রেশন নির্দেশাবলী অনুসরণ করা যাতে তারা IFRAME মোডের অধীনে সঠিকভাবে কাজ করে।
setSandboxMode পদ্ধতিতে এখন কল করার সময় কোন প্রভাব নেই।
IFRAME মোডে সীমাবদ্ধতা
IFRAME স্যান্ডবক্স মোড HTML5-এর iframe স্যান্ডবক্সিং বৈশিষ্ট্যের উপর ভিত্তি করে, নিম্নলিখিত কীওয়ার্ডগুলি ব্যবহার করে:
allow-same-origin
allow-forms
allow-scripts
allow-popups
allow-downloads
allow-modals
allow-popups-to-escape-sandbox
allow-top-navigation-by-user-activation - এই বৈশিষ্ট্যটি শুধুমাত্র স্বতন্ত্র স্ক্রিপ্ট প্রকল্পের জন্য সেট করা হয়েছে।
allow-top-navigation কীওয়ার্ড, যা বিষয়বস্তুকে তার শীর্ষ-স্তরের ব্রাউজিং প্রসঙ্গে নেভিগেট করার অনুমতি দেয়, সীমাবদ্ধ এবং স্যান্ডবক্সে একটি বৈশিষ্ট্য হিসাবে সেট করা হয় না। আপনি যদি আপনার স্ক্রিপ্ট পুনঃনির্দেশ করতে চান তবে ব্যবহারকারীর পরিবর্তে পদক্ষেপ নেওয়ার জন্য একটি লিঙ্ক বা একটি বোতাম যোগ করুন।
লিঙ্ক টার্গেট অ্যাট্রিবিউট সেট করা
IFRAME মোডে আপনাকে লিঙ্ক টার্গেট অ্যাট্রিবিউট _top বা _blank এ সেট করতে হবে:
[[["সহজে বোঝা যায়","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-08-04 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eApps Script utilizes iframes to sandbox HTML service web apps and custom interfaces for Google products, protecting users from malicious code.\u003c/p\u003e\n"],["\u003cp\u003eAll sandbox modes except \u003ccode\u003eIFRAME\u003c/code\u003e are sunset; existing scripts using older modes automatically transition to \u003ccode\u003eIFRAME\u003c/code\u003e, and developers should migrate their code accordingly.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eIFRAME\u003c/code\u003e sandbox mode, based on HTML5 iframe sandboxing, imposes limitations on client-side code with specific allowances and restrictions.\u003c/p\u003e\n"],["\u003cp\u003eTo redirect users in \u003ccode\u003eIFRAME\u003c/code\u003e mode, use links or buttons with \u003ccode\u003etarget="_top"\u003c/code\u003e or \u003ccode\u003e_blank"\u003c/code\u003e or utilize the \u003ccode\u003e<base>\u003c/code\u003e tag to override this behavior.\u003c/p\u003e\n"],["\u003cp\u003eActive content like scripts and external stylesheets within the sandboxed environment must be loaded over HTTPS to ensure security.\u003c/p\u003e\n"]]],[],null,["To protect users from being served malicious HTML or JavaScript, Apps Script\nuses iframes to sandbox HTML-service web apps or custom user\ninterfaces for Google Docs, Sheets, and Forms. (The HTML service does not use a\nsandbox in other situations, like generating the body of an email.) The sandbox\nimposes limitations on client-side code.\n\nSandbox Mode\n\nAll sandbox modes are now sunset except for `IFRAME`. Apps using older sandbox\nmodes now use the newer `IFRAME` mode automatically. If you have scripts that\nwere developed using the older modes (`NATIVE` and `EMULATED`), you should\nfollow the [migration instructions](/apps-script/migration/iframe) to ensure\nthey function properly under the `IFRAME` mode.\n\nThe [`setSandboxMode`](/apps-script/reference/html/html-output#setSandboxMode(SandboxMode))\nmethod now has no effect when called.\n\nRestrictions in IFRAME mode\n\nThe `IFRAME` sandbox mode is based on the\n[iframe sandboxing](https://html.spec.whatwg.org/#attr-iframe-sandbox) feature\nin HTML5, using the following keywords:\n\n- `allow-same-origin`\n- `allow-forms`\n- `allow-scripts`\n- `allow-popups`\n- `allow-downloads`\n- `allow-modals`\n- `allow-popups-to-escape-sandbox`\n- `allow-top-navigation-by-user-activation` - This attribute is only set for [stand-alone script projects](/apps-script/guides/standalone).\n\nThe `allow-top-navigation` keyword, which allows the content to navigate its\ntop-level browsing context, is restricted and not set as an attribute in the\nsandbox. If you need to redirect your script, add a link or a button for the\nuser to take action on instead.\n\nSetting the link target attribute\n\nIn the `IFRAME` mode you need to set the link target attribute to either\n`_top` or `_blank`: \n\nCode.js \n\n function doGet() {\n var template = HtmlService.createTemplateFromFile('top');\n return template.evaluate().setSandboxMode(HtmlService.SandboxMode.IFRAME);\n }\n\ntop.html \n\n \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003cbody\u003e\n \u003cdiv\u003e\n \u003ca href=\"http://google.com\" target=\"_top\"\u003eClick Me!\u003c/a\u003e\n \u003c/div\u003e\n \u003c/body\u003e\n \u003c/html\u003e\n\nYou can also override this attribute using the `\u003cbase\u003e` tag within the head\nsection of the enclosing web page: \n\n \u003c!DOCTYPE html\u003e\n \u003chtml\u003e\n \u003chead\u003e\n \u003cbase target=\"_top\"\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n \u003cdiv\u003e\n \u003ca href=\"http://google.com\"\u003eClick Me!\u003c/a\u003e\n \u003c/div\u003e\n \u003c/body\u003e\n \u003c/html\u003e\n\nHTTPS required for active content\n\n[\"Active\" content](https://developer.mozilla.org/en-US/docs/Security/MixedContent#Mixed_active_content)\nlike scripts, external stylesheets, and XmlHttpRequests must be loaded over\nHTTPS, not HTTP."]]