title: How use a preload script on electron?
body: <p>I am currently doing the following:</p>
  <pre><code>//main.js
  
  let window = new BrowserWindow (
      title: 'app',
      webPreferences: {
          preload: './preload.js'
      },
  )
  
  //preload.js 
  
  window.teste = &quot;hello&quot;
  
  //renderer.js
  
  console.log(window.teste)
  </code></pre>
  <p>but I always get undefined, as if everything that was done inside the preload (requires and etc), had no global scope or could not be accessed in any way</p>