在Ionic 3中,属性executeScript不会在Window类型上退出

时间:2018-10-22 11:32:13

标签: ionic3 inappbrowser

我正在尝试将数据从应用程序浏览器窗口中获取到我的应用程序。

var name,nameInterval;

var win: Window = window.open('https://s3.amazonaws.com/baltoinc/square/payment.html',"_blank", "location=yes")
 win.addEventListener("loadstop", function () {
win.executeScript({ code: "localStorage.setItem('Data', '')" });
  nameInterval = setInterval(function () {
    console.log('Interval Calling')
    //if(resP.innerHTML){
      let data = JSON.parse(localStorage.getItem('Data'))
      win.executeScript({ code: "localStorage.getItem('Data')" }, function(values) {
        name = data.Username
    });
 // }
  },1000)
})
win.addEventListener('exit', function () {
  console.log("Response", name)
  clearInterval(nameInterval);
});

我收到“ Window类型不存在属性executeScript”。

0 个答案:

没有答案
相关问题