title: New windows not able to acess NWJS modules?
body: <p>If I create a window using window.open on my NWJS application, it seems that this window cannot acess any nodejs or nwjs module at all. How to I work around it?</p>
  
  <p>I use document.write to write the content of the page, because it will be different according to the context in which the code is running.</p>
  
  <pre><code>    var fs = require("fs");
      var text = fs.readFileSync(myfolder);
  text=text.toString();
      var wndo = window.open("about:blank", "", "scrollbars=1,width=300,height=500");
  wndo.moveTo(screen.width/2-250,screen.height/2-175);
  
      wndo.document.write(`&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;JS Coder&lt;/title&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;link rel="stylesheet" href="editor/style.css"/&gt;
  &lt;/head&gt;
  
  &lt;input  style="display:none;" name="file" id="fileDialog" type="file" onchange="openeditor()" /&gt;
  &lt;label class="button button1" for="fileDialog"&gt;Open&lt;/label&gt;
  
  
  &lt;input style="display:none;" name="filesave" id="filesave" type="file" onchange="saveeditor()" nwsaveas /&gt;
  &lt;label class="button button1" for="filesave" &gt;Save&lt;/label&gt;
  
   &lt;div id="content" contenteditable="true"&gt;&lt;/div&gt;
  
  &lt;script src="editor/app.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
    document.getElementById('content').innerHTML = "`+text+`"
  
  &lt;/script&gt;
  
  &lt;/html&gt;`);
  </code></pre>
  
  <p>inside app.js there is:</p>
  
  <pre><code>document.getElementById('content').innerHTML = '';
  
  
  
  openeditor=function(){
  
  
  var fileinput = document.querySelector('input[type=file]');
  var path = fileinput.value;
  path=path.toString()
  
  var fs = require('fs');
  fs.readFile(path, 'utf8', function(err, txt) {
    if (err) {
      alert(err)
      return;
    }
  
    document.getElementById('content').innerHTML=txt
  });
  
  
  }
  saveeditor=function(){
  
  
  var fileinput = document.querySelector('input[id=filesave]');
  var path = fileinput.value;
  
  const fs = require("fs")
  
  texto=document.getElementById('content').innerHTML
  texto=texto.toString()
  
      fs.writeFile(path,texto , function (err) {
    if (err) return;
  });
  
  
  
  }
  </code></pre>
  
  <p>Is there a way to enable node/nwjs modules in that window? And if not, how do I open a new window in my application which has acess to node/nwjs modules and once open, execute code in it?</p>