<h3 dir="auto">Preflight Checklist</h3>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong>
<ul dir="auto">
<li>5.0.2</li>
</ul>
</li>
<li><strong>Operating System:</strong>
<ul dir="auto">
<li>Windows 10 (1903)</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong>
<ul dir="auto">
<li>4.*</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>

<p dir="auto">Using <code class="notranslate">baseURLForDataURL</code> option in <code class="notranslate">window.loadURL</code> should open new window using provided base url.</p>
<h3 dir="auto">Actual Behavior</h3>

<p dir="auto">Window doesn't open, throws error to console (screenshot provided).</p>
<h3 dir="auto">To Reproduce</h3>

<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const win = new remote.BrowserWindow()
win.current.loadURL(
  `data:text/html;charset=UTF-8,${encodeURIComponent('&lt;!DOCTYPE html&gt;')}`,
  { baseURLForDataURL: 'http://...' },
)"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">win</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">remote</span><span class="pl-kos">.</span><span class="pl-c1">BrowserWindow</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-s1">win</span><span class="pl-kos">.</span><span class="pl-c1">current</span><span class="pl-kos">.</span><span class="pl-en">loadURL</span><span class="pl-kos">(</span>
  <span class="pl-s">`data:text/html;charset=UTF-8,<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-en">encodeURIComponent</span><span class="pl-kos">(</span><span class="pl-s">'&lt;!DOCTYPE html&gt;'</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span>
  <span class="pl-kos">{</span> <span class="pl-c1">baseURLForDataURL</span>: <span class="pl-s">'http://...'</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">)</span></pre></div>


<h3 dir="auto">Screenshots</h3>

<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/22496946/58470075-9857d700-8149-11e9-9137-97c3e27e9755.png"><img width="721" alt="Screenshot 2019-05-28 13 07 32" src="https://user-images.githubusercontent.com/22496946/58470075-9857d700-8149-11e9-9137-97c3e27e9755.png" style="max-width: 100%;"></a></p>
### Additional Information
<h3 dir="auto">Preflight Checklist</h3>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong></li>
<li>7.0.0</li>
<li><strong>Operating System:</strong></li>
<li>Arch Linux</li>
<li><strong>Last Known Working Electron version:</strong></li>
<li>6.0.10</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>

<p dir="auto">Opening a <code class="notranslate">webview</code> with a preset source as in:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;webview src=&quot;https://github.com&quot;&gt;&lt;/webview&gt;
&lt;script&gt;
webview.loadURL(
   `data:text/html;charset=utf-8;base64,
    PGgxPkhBTExPPC9oMT4=
  `, { baseURLForDataURL: `file://home/` })
// the base64 string is just &lt;h1&gt;HALLO&lt;/h1&gt;
&lt;/script&gt;"><pre class="notranslate"><code class="notranslate">&lt;webview src="https://github.com"&gt;&lt;/webview&gt;
&lt;script&gt;
webview.loadURL(
   `data:text/html;charset=utf-8;base64,
    PGgxPkhBTExPPC9oMT4=
  `, { baseURLForDataURL: `file://home/` })
// the base64 string is just &lt;h1&gt;HALLO&lt;/h1&gt;
&lt;/script&gt;
</code></pre></div>
<p dir="auto">loads the github URL and then reloads the webview with <code class="notranslate">HALLO</code>.</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">Electron crashes</p>

<h3 dir="auto">To Reproduce</h3>
<p dir="auto">See this repo:<br>
<a href="https://github.com/burningTyger/webview-bug">https://github.com/burningTyger/webview-bug</a></p>




<h3 dir="auto">Screenshots</h3>

<h3 dir="auto">Additional Information</h3>