title: how to use localstorage in electron
body: <p>In an electron app, I use <code>window.loadURL('http://example.com')</code> to load my website, this website uses <code>localStorage</code> to save user data. My question is how to use the <code>localStorage</code> with Electron API?</p>
  
  <p>Here is my code :</p>
  
  <pre><code>{
        label:'test',
        click:()=&gt;{          
          let object = mainWindow.webContents.executeJavaScript('localStorage.length');
          console.log("localstorage.length:"+JSON.stringify(object));
        }
      }
  </code></pre>
  
  <p>But it will print <code>localstorage.length:{}</code></p>