title: Open a new tab/window and write something to it?
body: <p>I'm using <a href="https://addons.mozilla.org/vi/firefox/addon/execute-js/?src=search">Execute JS</a> to write and test Javascript code within Firefox. I want to open a new tab/window and write something to it and I tried</p>
  
  <pre><code>var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
  var win = wm.getMostRecentWindow("navigator:browser");
  printWindow = win.open("about:blank");
  printWindow = wm.getMostRecentWindow("navigator:browser");
  printWindow.gBrowser.selectedBrowser.contentDocument.write('hello');
  </code></pre>
  
  <p>And</p>
  
  <pre><code>myWindow=window.open('','','width=200,height=100')
  myWindow.document.write("&lt;p&gt;This is 'myWindow'&lt;/p&gt;")
  myWindow.focus()
  </code></pre>
  
  <p>However I always get this error </p>
  
  <blockquote>
    <p>[Exception... "The operation is insecure."  code: "18" nsresult:
    "0x80530012 (SecurityError)"</p>
  </blockquote>
  
  <p>Is there any way to get through this exception?</p>