title: Google Chrome UserScript - Working with other windows and tied-up hands
body: <p>I've got a little problem with UserScripts in Google Chrome, to be precise with getting to the object window of an iframe. Very doable via the Google Chrome console, very impossible via the UserScript or so it seems so far. To be honest it seems as if it was on purpose, as if there was some reason why I'm not allowed to access other window objects.</p>
  
  <pre><code>document.body.innerHTML += "&lt;iframe name='iframe'&gt;&lt;/iframe&gt;";
  console.log(top.frames.iframe);
  console.log(window.frames.iframe);
  console.log(unsafeWindow.frames.iframe);
  console.log(document.getElementsByName('iframe')[0].contentWindow);
  console.log(document.getElementsByName('iframe')[0].contentDocument.defaultView);
  </code></pre>
  
  <p>--></p>
  
  <pre><code>chrome-extension://eelclpmekkanegjojjmaldeddncficoj/script.js:14 undefined
  chrome-extension://eelclpmekkanegjojjmaldeddncficoj/script.js:15 undefined
  chrome-extension://eelclpmekkanegjojjmaldeddncficoj/script.js:16 undefined
  chrome-extension://eelclpmekkanegjojjmaldeddncficoj/script.js:17 undefined
  chrome-extension://eelclpmekkanegjojjmaldeddncficoj/script.js:18 undefined
  </code></pre>
  
  <p>Might I ask what Chrome's problem is? I don't really get why should a UserScript have lesser access to javascript than a normal script, what are the implications? By the way, yes, the iframe is on the same domain and protocol. :(</p>