How to detect ionic view?


Do anyone know how to detect if an app is being viewed in ionic view ?
Something like‘ionic-view’)

  • Ulrik


I recommend you look at this thread. It would appear Ionic has not provided a solution to this. One possible workaround is @lotterfriendsgist here.


Nice thanks, just what I needed :slight_smile:


As of now this answer no longer works as location.href is just localhost:port/index.html!

Absolutely shocking that Ionic doesn’t provide a way to detect this and instead it lies and says platform is “Cordova” when Cordova plugins aren’t available inside IonicView. I don’t understand this choice considering the number of years Ionic has been around.

For those who come across this in the future, I ended up putting a hack together to check the location.href and if the address is the value that it is in IonicView then I know I’m inside IonicView.