title: Open a new window and get its location after loading
body: <p>I am using this code to open a new window:</p>
  
  <pre><code>Window w = window.open('example2.com', 'example2'); // Consisder than my domain
                                                      // is example1.com
  </code></pre>
  
  <p>This part of code works ok and succesfully opens a new window. Than i am trying to call my function after loading finishes.</p>
  
  <pre><code>w.onLoad.listen(locationGetter);
  </code></pre>
  
  <p>This is a code of locationGetter() function:</p>
  
  <pre><code>locationGetter(Event e) {
    Location currentLocation = w.location;
    currentHref = currentLocation.href; // currentHref is var defined
  }                                    // in main() function
  </code></pre>
  
  <p>But this code doesn't work well. Every time when I run my script both currentLocation and currentHref is null. At the beginning i thought that problem was in onLoad event, so i tried to call w.location exacly after opening a window:</p>
  
  <pre><code>Window w = window.open('example2.com', 'example2');
  Location currentLocation = w.location; // still null
  </code></pre>
  
  <p>I am pretty sure that both Window and WindowBase has location property. Please help me with my problem or provide alternative solution of this task.</p>