Questions and discussions about using the Shopify CLI and Shopify-built libraries.
Hello there,
I want to make sure that my Shopify application doesn't get embedded inside Shopify. I have already disabled "Embedded app" option inside extensions but sometime Shopify embeds it inside the dashboard.
Is there any way I can force Shopify to stop embedding my app?
Thanks.
This seems strange.. I'm not sure why this would happen. As a temporary fix you could of course check to see if the app is loaded in an iframe, and then use the App Bridge or the Embedded app sdk to redirect..
if (window.location !== window.parent.location) {
app.dispatch(Redirect.toRemote({ url: location.href, }));
}
Thank you @copleykj for your solution. Unfortunately, this requires me to remove `X-Frame-Options: DENY` from my responses, otherwise the snippet you shared will never get executed.
I do not want to unset `X-Frame-Options: DENY` for various reasons.
Do you think there's some issue with Shopify Partners dashboard? Especially with the Extensions settings?
Thanks.
I would say that if it's not something that you've missed on your end, then it must be some issue with Shopify. If you can't get an answer from staff here, it might be best to contact support. https://help.shopify.com/en/questions
Hi Kevin,
Check out the instructions on this page:
https://help.shopify.com/en/api/embedded-apps/app-bridge/initialization
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.
Are you using EASDK or App Bridge anywhere in your app?
To learn more visit the Shopify Help Center or the Community Blog.
Hello @iain-campbell
No, I am not using app-bridge anywhere.
Furthermore, this is only happening if user hasn't logged into Shopify store before starting the OAuth process. So if user is visiting my app first and initiating OAuth from my app, it always loads my app inside iframe in dashboard.
😕
Hi Kevin,
Thanks for the additional info. Would you be able to link to your app here so we can try to reproduce the issue? You can also message me directly if you'd prefer.
To learn more visit the Shopify Help Center or the Community Blog.