Skip to main content
2 of 2
added 181 characters in body
Robert Lindgren
  • 24.5k
  • 12
  • 53
  • 79

Would this not work? Using the fact that Layouts is shared through the fram

targetUrl = '/_layouts/MyProject/AppPage.aspx' + "?Location=" + window.location.href;

or you could try:

targetUrl = SP.Utilities.Utility.getLayoutsPageUrl('MyProject/AppPage.aspx' + "?Location=" + window.location.href)
Robert Lindgren
  • 24.5k
  • 12
  • 53
  • 79