title: Detecting browser iframe vs native app in Office add-in
body: <p>I'm currently writing an Outlook Add-in and was implementing <a href="https://github.com/OfficeDev/office-js-docs/blob/master/docs/develop/privacy-and-security.md#tips-to-prevent-clickjacking" rel="nofollow noreferrer">clickjacking protection</a> by showing the user a confirmation pop-up window before they complete a potentially dangerous action in the add-in.</p>
  
  <p>It doesn't seem necessary to show these pop-ups when my add-in is running outside of a browser, though (e.g. in Outlook for Mac, or Outlook 2016).</p>
  
  <p>Is there a way to detect whether my add-in is running in a browser vs. running in a native app? I've thought about inspecting the user-agent, but that seems a little fragile.</p>
  
  <hr>
  
  <p>Edit: This is not the same question as <a href="https://stackoverflow.com/questions/43667426">Trusted way to get the host origin of an Office add-in</a> because this question is about whether the add-in is being iframed at all, whereas being iframed is one of the starting assumptions in <a href="https://stackoverflow.com/questions/43667426">Trusted way to get the host origin of an Office add-in</a>.</p>