با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
شما از لیست های مجاز برای تعیین URL های خاصی استفاده می کنید که از قبل برای دسترسی توسط اسکریپت یا افزونه شما تأیید شده اند. لیست های مجاز به محافظت از داده های کاربر کمک می کند. وقتی یک لیست مجاز را تعریف می کنید، پروژه های اسکریپت نمی توانند به URL هایی که به لیست مجاز اضافه نشده اند دسترسی پیدا کنند.
این فیلد هنگام نصب یک استقرار آزمایشی اختیاری است، اما زمانی که یک استقرار نسخهسازی شده ایجاد میکنید لازم است.
هنگامی که اسکریپت یا افزونه شما اقدامات زیر را انجام می دهد از لیست های مجاز استفاده می کنید:
با استفاده از سرویس Apps Script UrlFetch اطلاعات را از یک مکان خارجی (مانند نقاط پایانی HTTPS) بازیابی یا واکشی می کند. برای واکشی URLهای لیست مجاز، فیلد urlFetchWhitelist را در فایل مانیفست خود قرار دهید.
URL را در پاسخ به اقدام کاربر باز می کند یا نمایش می دهد (برای افزونه های Google Workspace که URL هایی را که خارج از Google هستند باز یا نمایش می دهند لازم است). برای باز کردن URL های لیست مجاز، فیلد addOns.common.openLinkUrlPrefixes را در فایل مانیفست خود قرار دهید.
اضافه کردن پیشوندها به لیست مجاز شما
هنگامی که لیست های مجاز را در فایل مانیفست خود مشخص می کنید (با گنجاندن فیلد addOns.common.openLinkUrlPrefixes یا urlFetchWhitelist )، باید فهرستی از پیشوندهای URL را وارد کنید. پیشوندهایی که به مانیفست اضافه می کنید باید شرایط زیر را برآورده کنند:
هر پیشوند باید یک URL معتبر باشد.
هر پیشوند باید https:// استفاده کند نه http:// .
هر پیشوند باید یک دامنه کامل داشته باشد.
هر پیشوند باید یک مسیر غیر خالی داشته باشد. به عنوان مثال، https://www.google.com/ معتبر است اما https://www.google.com معتبر نیست.
برای مطابقت با پیشوندهای زیر دامنه URL می توانید از حروف عام استفاده کنید.
میتوان از یک علامت * در فیلد addOns.common.openLinkUrlPrefixes برای مطابقت با همه پیوندها استفاده کرد، اما این کار توصیه نمیشود زیرا میتواند دادههای کاربر را در معرض خطر قرار دهد و روند بررسی افزودنی را طولانیتر کند. فقط در صورتی از علامت عام استفاده کنید که عملکرد افزونه شما به آن نیاز داشته باشد.
هنگام تعیین اینکه آیا URL با پیشوند لیست مجاز مطابقت دارد، قوانین زیر اعمال می شود:
تطبیق مسیر به حروف کوچک و بزرگ حساس است.
اگر پیشوند با URL یکسان باشد، مطابقت دارد.
اگر URL یکسان یا فرزند پیشوند باشد، مطابقت دارد.
به عنوان مثال، پیشوند https://example.com/foo با URL های زیر مطابقت دارد:
https://example.com/foo
https://example.com/foo/
https://example.com/foo/bar
https://example.com/foo?bar
https://example.com/foo#bar
استفاده از حروف عام
میتوانید از یک کاراکتر عام ( * ) برای تطبیق یک زیر دامنه برای فیلدهای urlFetchWhitelist و addOns.common.openLinkUrlPrefixes استفاده کنید. شما نمی توانید از بیش از یک علامت عام برای تطبیق چندین زیردامنه استفاده کنید و علامت عام باید نشان دهنده پیشوند اصلی URL باشد.
برای مثال، پیشوند https://*.example.com/foo با URL های زیر مطابقت دارد:
https://subdomain.example.com/foo
https://any.number.of.subdomains.example.com/foo
پیشوند https://*.example.com/foo با URL های زیر مطابقت ندارد :
https://example.com/foo (حداقل یک زیر دامنه باید وجود داشته باشد)
وقتی میخواهید مانیفست خود را ذخیره کنید، برخی از قوانین پیشوند اجرا میشوند. به عنوان مثال، اگر پیشوندهای زیر هنگام ذخیره کردن در مانیفست شما وجود داشته باشند، با خطا مواجه می شوند:
https://*.*.example.com/foo (چند نویسه ممنوع است)
https://subdomain.*.example.com/foo (کارت های عام باید به عنوان پیشوند اصلی استفاده شوند)
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eAllowlists specify approved URLs for your script or add-on to access, enhancing user data protection by restricting access to unlisted URLs.\u003c/p\u003e\n"],["\u003cp\u003eAllowlists are necessary for scripts that fetch external data or open external links, especially for versioned deployments and Google Workspace Add-ons.\u003c/p\u003e\n"],["\u003cp\u003eWhen defining allowlists, use HTTPS prefixes with full domains, non-empty paths, and optional wildcards for subdomains, ensuring adherence to specific formatting rules.\u003c/p\u003e\n"],["\u003cp\u003eAllowlist prefixes are matched against URLs based on case-sensitive path comparisons, allowing access to identical URLs or child paths of the prefix.\u003c/p\u003e\n"],["\u003cp\u003eWildcards can represent subdomains in allowlist prefixes but must be used as the leading prefix and cannot be used to match multiple subdomains simultaneously.\u003c/p\u003e\n"]]],[],null,["# Allowlist URLs\n\nYou use allowlists to designate specific URLs that are pre-approved for access\nby your script or add-on. Allowlists help protect user\ndata; when you define an allowlist, script projects can't access URLs that have\nnot been added to the allowlist.\n\nThis field is optional when you install a test deployment, but is required when\nyou create a versioned deployment.\n\nYou use allowlists when your script or add-on performs\nthe following actions:\n\n- Retrieves or fetches information from an external location (such as HTTPS endpoints) using the Apps Script [`UrlFetch`](/apps-script/reference/url-fetch) service. To allowlist URLs for fetching, include the [`urlFetchWhitelist`](/apps-script/manifest#Manifest.FIELDS.urlFetchWhitelist) field in your manifest file.\n- Opens or displays a URL in response to a user action (Required for Google Workspace add-ons that open or display URLs that are external to Google). To allowlist URLs for opening, include the [`addOns.common.openLinkUrlPrefixes`](/apps-script/manifest/addons#Common.FIELDS.openLinkUrlPrefixes) field in your manifest file.\n\n| **Note:** *Whitelist* , as used in [`urlFetchWhitelist`](/apps-script/manifest#Manifest.FIELDS.urlFetchWhitelist), is a deprecated term that is synonymous with and replaced by *allowlist* . For more information, see [Writing inclusive documentation](https://developers.google.com/style/inclusive-documentation).\n\n### Adding prefixes to your allowlist\n\nWhen you specify allowlists in your manifest file (by including either the\n`addOns.common.openLinkUrlPrefixes` or `urlFetchWhitelist` field), you must\ninclude a list of URL prefixes. The prefixes you add to the manifest must\nsatisfy the following requirements:\n\n- Each prefix must be a valid URL.\n- Each prefix must use `https://`, not `http://`.\n- Each prefix must have a full domain.\n- Each prefix must have a non-empty path. For example, `https://www.google.com/` is valid but `https://www.google.com` is not.\n- You can use [wildcards](#using_wildcards) to match URL subdomain prefixes.\n- A single `*` wildcard can be used in the [`addOns.common.openLinkUrlPrefixes`](/apps-script/manifest/addons#Common.FIELDS.openLinkUrlPrefixes) field to match all links, but this is not recommended as it can expose a user's data to risk and can prolong the [add-on review](/workspace/add-ons/concepts/gsuite-addon-review) process. Only use a wildcard if your add-on functionality requires it.\n\nWhen determining if a URL matches a prefix in the allowlist, the following rules\napply:\n\n- Path matching is case-sensitive.\n- If the prefix is identical to the URL, it is a match.\n- If the URL is the same or a child of the prefix, it is a match.\n\nFor example, the prefix `https://example.com/foo` matches the following URLs:\n\n- `https://example.com/foo`\n- `https://example.com/foo/`\n- `https://example.com/foo/bar`\n- `https://example.com/foo?bar`\n- `https://example.com/foo#bar`\n\n### Using wildcards\n\nYou can use a single wildcard character (`*`) to match a subdomain for both the\n[`urlFetchWhitelist`](/apps-script/manifest#Manifest.FIELDS.urlFetchWhitelist)\nand [`addOns.common.openLinkUrlPrefixes`](/apps-script/manifest/addons#Common.FIELDS.openLinkUrlPrefixes)\nfields. You can't use more than one wildcard to match multiple subdomains, and\nthe wildcard must represent the leading prefix of the URL.\n\nFor example, the prefix `https://*.example.com/foo` matches the following\nURLs:\n\n- `https://subdomain.example.com/foo`\n- `https://any.number.of.subdomains.example.com/foo`\n\nThe prefix `https://*.example.com/foo` *doesn't* match the following\nURLs:\n\n- `https://subdomain.example.com/bar` (suffix mismatch)\n- `https://example.com/foo` (at least one subdomain must be present)\n\nSome of the prefix rules are enforced when you try to save your manifest. For\nexample, the following prefixes cause an error if they are present in your\nmanifest when you attempt to save:\n\n- `https://*.*.example.com/foo` (multiple wildcards are forbidden)\n- `https://subdomain.*.example.com/foo` (wildcards must be used as a leading prefix)"]]