How to: Navigate to more than one domain within the same app pane
Learn how to navigate to another domain from the current app page without opening a new browser window.
Applies to: Office 2013 | Office 365 | apps for Office | Excel Web App | Exchange 2013 | Outlook 2013 | Outlook Web App | Project Professional 2013 | Word 2013 | Excel 2013 | PowerPoint 2013 | OWA for Devices
By default, if your app attempts to navigate to a URL in a domain other than the domain that hosts the start page of your app (as specified in the SourceLocation element of the app's manifest file), that URL will open in a new browser window outside of the Office host application's app pane. This default behavior protects the user against unexpected page navigation within the app pane from embedded iframe elements.
To override this behavior, you need to specify each domain you want to open in the app window in the list of domains specified within the AppDomains element of your app's manifest file. If the app attempts to navigate to a URL in a domain that isn't in the list, that URL will open in a new browser window (outside of the app pane).
The following XML manifest example hosts its main app page in the https://www.contoso.com domain as specified in the SourceLocation element. It also specifies the https://www.northwindtraders.com domain in an AppDomain element within the AppDomains element list. If the app navigates to a page in the www.northwindtraders.com domain, that page will open in the app pane.
<?xml version="1.0" encoding="UTF-8"?> <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TaskPaneApp"> <Id>c6890c26-5bbb-40ed-a321-37f07909a2f0</Id> <Version>1.0</Version> <ProviderName>Contoso, Ltd</ProviderName> <DefaultLocale>en-US</DefaultLocale> <DisplayName DefaultValue="Northwind Traders Excel" /> <Description DefaultValue="Search Northwind Traders data from Excel"/> <AppDomains> <AppDomain>https://www.northwindtraders.com</AppDomain> </AppDomains> <Capabilities> <Capability Name="Workbook" /> </Capabilities> <DefaultSettings> <SourceLocation DefaultValue="https://www.contoso.com/search_app/Default.aspx" /> </DefaultSettings> <Permissions>ReadWriteDocument</Permissions> </OfficeApp>