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.
Last modified: January 19, 2015
Applies to: Access app for SharePoint | Excel 2013 | Excel 2013 RT | Excel 2013 SP1 | Excel Online | Outlook 2013 | Outlook 2013 RT | Outlook 2013 SP1 | Outlook for Mac for Office 365 | Outlook Web App | OWA for Devices | PowerPoint 2013 | PowerPoint 2013 RT | PowerPoint 2013 SP1 | PowerPoint Online | Project 2013 | Project 2013 SP1 | Word 2013 | Word 2013 RT | Word 2013 SP1
Office.js: v1.0, v1.1
Apps for Office manifests schema: v1.0, v1.1
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.1" 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> <DefaultSettings> <SourceLocation DefaultValue="https://www.contoso.com/search_app/Default.aspx" /> </DefaultSettings> <Permissions>ReadWriteDocument</Permissions> </OfficeApp>