如何获取由 JS 打开的弹出窗口的 url。这是我的代码:
var _url = 'someurlhere';
var popupwindow = window.open(_url, "Popup", 'width=800, height=600');
var _this = this;
var pollTimer = window.setInterval(function() {
try {
console.log(popupwindow.document.URL);
} catch(e) {
console.log(e.message);
}
}, 500);
但我在Cannot read property 'URL' of undefined
console.log(e.message) 上遇到错误。为什么 ?