Search code examples
javascriptoffice365office-addinsoutlook-web-appoutlook-web-addins

How to enable allow-top-navigation from sandbox attribute in office 365 addins


We are creating an office add in where on button click we are posting data to new web page but expecting page should open in same browser window.

Currently it is not possible as add in pane is inside iframe and has sandbox attribute applied to it. is there any setting present though which we can add "allow-top-navigation" value in sandbox attribute?


Solution

  • There are two possible interpretations of what you're asking:

    1. Navigate the add-in page itself to a new location (eg. the page within the task pane), on any platform like Office Online, on the Windows Desktop, iPad, etc.
    2. Navigate the parent Office page itself to a new location, when the add-in is being used in Office Online in the browser

    (1) is supported: use a normal navigation API (like location.href) and ensure that your add-in manifest file includes the destination domain in the list of AppDomains.

    (2) is not supported.

    -Michael (PM for add-ins)