Display Something while app outside of Frame for Embedded Apps

Solved
achieveapplabs
Shopify Partner
470 36 74

Hi there,

 

How to display or at least detect your app is loading outside of Shopify when developing an embedded app?

 

Regards,

 

Sam

Install Approovly to create and track order approvals | We want to hear from you hello@achieveapplabs.com | Follow us on Twitter @achieveapplabs | Custom Shopify Apps achieveapplabs.com
0 Likes
ashukasma
Shopify Partner
37 10 12

I think you can check following code to detect 

 

if (window.top == window.self) {
//Not in App } else{ //In App }
Shopify Expert - https://experts.shopify.com/lucentinnovation
achieveapplabs
Shopify Partner
470 36 74

This is an accepted solution.

Thanks @ashukasma ,

 

That gives us the results we want. 

 

Regards,

 

Sam

Install Approovly to create and track order approvals | We want to hear from you hello@achieveapplabs.com | Follow us on Twitter @achieveapplabs | Custom Shopify Apps achieveapplabs.com
0 Likes