Back button iframe history back problem


I have one iframe in page.

If android device press back button, I want to iframe history go back.

But now, app exit.

How do I fix my Code?

Below is my Code.

------ in html

iframe id is “myframe”

------- in ts

constructor(public navCtrl: NavController) {

document.addEventListener("backbutton", () => {
  var iframe = document.getElementById('myframe');
  iframe['contentWindow'].history.back();   //doesn't work
  iframe.contentWindow.history.back();  //compile error

}, false);