AppDomain element
Specifies an additional domain that Office should trust, in addition to the one specified in the SourceLocation element. Specifying a domain has these effects:
- It enables pages, routes, or other resources in the domain to be opened directly in the root task pane of the add-in on desktop Office platforms. (Specifying a domain in an <AppDomain> isn't necessary for Office on the web or to open a resource in an IFrame, nor it is necessary for opening a resource in a dialog opened with the Dialog API.)
- It enables pages in the domain to make Office.js API calls from IFrames within the add-in.
Add-in type: Content, Task pane, Mail
Syntax
<AppDomain>string</AppDomain>
Important
- The value of the <AppDomain> element must include the protocol (for example,
<AppDomain>https://myappdomain.com</AppDomain>
), and the protocol must be eitherhttp
orhttps
. - If there is an explicit port for the domain, include it (for example,
<AppDomain>https://myappdomain.com:9999</AppDomain>
). - If a subdomain needs to be trusted, include it (for example,
<AppDomain>https://mysubdomain.myappdomain.com</AppDomain>
). The subdomainmysubdomain.mydomain.com
andmydomain.com
are different domains. If both need to be trusted, then both need to be in separate <AppDomain> elements. - Listing the same domain as the one specified in the SourceLocation element has no effect and may be misleading. When developing on
localhost
, you don't usually need to create an <AppDomain> element for it. However, if you're implementing the Dialog API in an add-in that runs on Outlook on the web or the new Outlook on Windows, you must create an <AppDomain> element forlocalhost
. - Don't include any segments of a URL past the domain. For example, don't include the full URL of a page.
- Do not put a closing slash, "/", on the value.
- Wildcards, such as
*
, aren't allowed in <AppDomain> values; however, for add-ins running only in Office on Windows, there's a way to designate additional trusted domains with wildcards. See Wildcard trusted domains.
Contained in
Remarks
For more information, see Office Add-ins with an add-in only manifest.
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
Office Add-ins