title: webContents.savePage Alternative for Electron apps in Windows Build
body: <p>Recently, I was trying to build Electron Apps for &quot;Windows and Macintosh&quot;.</p>
  <ul>
  <li>I had to download the current web page running using the &quot;load URL&quot; method in Browser Window.</li>
  </ul>
  <p>In Macintosh, when I run below function:</p>
  <pre class="lang-js prettyprint-override"><code>const { BrowserWindow } = require('electron')
  let win = new BrowserWindow()
  
  win.loadURL('https://github.com')
  
  win.webContents.on('did-finish-load', async () =&gt; {
    win.webContents.savePage('/tmp/test.html', 'HTMLComplete').then(() =&gt; {
      console.log('Page was saved successfully.')
    }).catch(err =&gt; {
      console.log(err)
    })
  })
  </code></pre>
  <p>and When I load the &quot;stackoverflow.html&quot; file in the App, It runs the download page for offline use and replaces old stackoverflow.html content as &quot;It works&quot; too - &quot;StackOverflow HTML&quot; code as well as all CSS, JS file in <code>stackoverflow_files</code> directory.</p>
  <p>But When I run the same function in &quot;Windows Build&quot; - It just doesn't save. I tried debugging the issue by printing the event in <code>console.log</code>, it does say - &quot;Page has been downloaded and provides path&quot;, but when I access the page, it has not downloaded anything and Original content &quot;It works&quot; is always shown.</p>
  <p>Is there any other way, we can download webPage just like how &quot;savePage&quot; works in Macintosh for Windows?</p>
  <p>savePage API documentation - <a href="https://www.electronjs.org/docs/api/web-contents#contentssavepagefullpath-savetype" rel="nofollow noreferrer">https://www.electronjs.org/docs/api/web-contents#contentssavepagefullpath-savetype</a></p>