Picking a popup title

2

I need to get the title or URL of a popup .

Inside my system has a button, clicking opens this popup with an external site

For example:

window.open("http://baixaki.com.br/", options);

How do I get the title of this popup ?

    
asked by anonymous 18.09.2015 / 20:28

1 answer

3

Can not get data from a pop-up on an external link because of Same-origin policy .

Just curious, if the popup was an internal link, you could do it like this:

/* ... */
  var win = window.open('link.html');
  win.addEventListener('load', function() {
    console.log(win.document.title);
  });
/* ... */
    
18.09.2015 / 20:42