Embedded app navigation breaks after window.location.href file download

Hi everyone,

Has anyone else noticed this recently with Shopify App Bridge?

In several embedded apps, if I trigger a file download using window.location.href:

window.location.href = '/my-file-download-endpoint';

the file downloads correctly, but after that the embedded app navigation breaks. Clicking items in ui-nav-menu does nothing until the app is refreshed.

Workaround was to trigger the download through a hidden iframe instead of replacing the current app URL:

const iframe = document.createElement('iframe');
iframe.src = downloadUrl;
iframe.style.display = 'none';
document.body.appendChild(iframe);

Curious if this is expected behavior, a recent App Bridge regression, or if Shopify recommends another approach for downloads inside embedded apps.

Could you try this approach, see if this works for you

const download = document.createElement('a');
  download.href = url;
  download.target = '_blank';
  download.download = filename;
  download.click();
  download.remove();