title: Bookmarklet, js injection and popup issue
body: <p>I'm currently writing a bookmarklet that loads and executes a remote js file by appending a new <code>&lt;script&gt;</code> tag in the current window, like so :</p>
  
  <pre><code>javascript:(function() {
      if(typeof __bml_main != "undefined") return __bml_main.init();
      var s= document.createElement('script');
      s.type= 'text/javascript';
      s.src= 'http://127.0.0.1:8000/media/bookmarklet.js';
      void(document.body.appendChild(s));
  })();</code></pre>
  
  <p>My bookmarklet needs to perform some dom manipulations in order to extract data from the page being viewed, and then to open a new popup to list them.</p>
  
  <p>The thing is : if I want to bypass pop-up blockers, I can't open my new window from the injected script. I need to open it right from the beginning in the bookmarklet code, and to access it later when needed.</p>
  
  <p>I've tried to do somehting like this :</p>
  
  <pre><code>javascript:var my_popup = window.open('http://127.0.0.1:8000/resources/manage/new/', 'newResourcePopup',config='height=200,width=400,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no');
  (function() {
  // script injection (...)
  })();</code></pre>
  
  <p>but if I then try to access <code>my_popup</code> from my remotely loaded script, most browsers will throw a security warning and won't let me access the Window object. This is understandable since the script is not from the same domain than the displayed page, but I'm kind of stuck...</p>
  
  <p>A solution would be to use a div overlay, but I'd really prefer to open a window in this case.</p>
  
  <p>Any hints ?</p>