THE SITUATION:
I am testing my Shopify app.
Until few days ago it was working fine.
The intended behavior was it to be opened embedded in Shopify dashboard.
Recently when I click on the app it opens in a new tab at the following url:
https://[STORE-ID].myshopify.com/admin/apps/[APP-NAME]?force_legacy_domain=1
Note the force_legacy_domain
param added to the url.
SHOPIFY DOMAIN CHANGE
It seems there have been some changes in the Shopify admin url.
With the new change it should be opened at the following url:
https://admin.shopify.com/store/[STORE-NAME]/apps/[APP-NAME]
QUESTION:
How can I avoid opening the app in a new tab?
2
Answers
I think you answer this one by simply ensuring you are keeping track of the right parameters, and Shopify will not do the new tab. So ensure you have your host and shop parameters throughout the lifecycle of all calls to your App. If you are not setting the host, or handling the admin.shopify.com domain correctly, Shopify is sending you to the legacy handler, and that opens your App in a new tab it seems, reminding you to ensure you are handling all the parameters correctly for both the new and hold Shopify App domains.
Looks like this may be a bug on Shopify’s end.
There is a github issue reported here:
https://github.com/Shopify/shopify-app-bridge/issues/160#issuecomment-1425990569
And there is a thread I found on the Shopify developer forums: https://community.shopify.com/c/technical-q-a/force-legacy-domain-1-cascading-redirects-using-shopify-app/td-p/1938587