我正在尝试将数据从应用程序浏览器窗口中获取到我的应用程序。
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”。