The script detects if your app was loaded inside an iframe. If it wasn't, then the script creates a redirection back into the relative embedded URL in the Shopify admin. You can disable this functionality by passing forceRedirect: false as a configuration option.
Set up the Shopify TitleBar
On every page of your app, you should define the behavior of the Shopify TitleBar in relation to your application. For single-page apps (SPAs) you can update the title bar based on your app state. The following example script updates the TitleBar.
Using CDN-hosted version:
After you've initialized your app, you can use any Shopify App Bridge actions. To learn more about the supported actions, see Actions.