Iframe and cordova/ionic back button

i am using iframe to load up a webpage inside one of my view for ionic.

<iframe name="siteFrame" id="siteFrame" src="www.example.com" style="width:100%; height:100%" ></iframe>

what happens is that when the backbutton is pressed instead of going back to the previous page in the iframe the app exists.

i cannot detect the current href of the iframe as the cross domain security issues prevents me.

what i want to do is that the phones back button should work on the
iframe but when the iframe is at it’s home page the backbutton should
work for the views then

How can this be done?
if it cant then please mention any other way i can load webpages in a view?

I’ve never tried an iframe in a cordova application, but have you tried using InAppBrowser? (It’s also available using ngCordova: http://ngcordova.com/docs/plugins/inAppBrowser/)

Here is a short tutorial on it: https://blog.nraboy.com/2014/07/launch-external-urls-ionicframework/

i want to have the tabs bar and other navigation over the site that is loaded… i am doing that with the iframe but can it be done using the inappbrowser.

what i am trying to achieve is that i want the site to load up in my app but i want to overlay buttons and other navigation to some different pages so iframe seemed the best option.

Do let me know if i can achieve this using something else

To handle ionic back button press event and navigate the iframe from there. check the below link https://sathesh.in/ionic/iframe-and-cordova-ionic-back-button/