<ul dir="auto">
<li>Electron version:<br>
v2.0.0</li>
<li>Operating system:<br>
Windows 10 64bit</li>
<li>Last known working Electron version:<br>
Unknown</li>
</ul>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">In the dev tool's timeline, the listener/node count (and the JS Heap size?) should go back down when webviews are removed. They should not show up in Detached DOM tree when taking a heap snapshot. It's as if they never existed.</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">If you don't add a preload script the memory consumption eventually goes back down, but if you do, it doesn't, even with manual garbage collection. Also regardless, the number of nodes and listeners just keeps increasing. If I take a heap snapshot I can see all the elements are under Detached DOM trees in Containment.</p>
<p dir="auto">I thought maybe I was closing the webviews incorrectly, but there's isn't any documentation on this, except for the close event example which seemed to imply one should set the src to <code class="notranslate">about:blank</code> on close. So I tried just setting it to <code class="notranslate">about:blank</code> from the start and this allowed the memory to drop back down with the preload script (but listener/node count still increases). Is this intended behavior?</p>
<h3 dir="auto">How to reproduce</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  $ git clone https://github.com/AlansCodeLog/electron-quick-start.git -b webview-problem
  $ npm install
  $ npm start || electron ."><pre class="notranslate"><code class="notranslate">  $ git clone https://github.com/AlansCodeLog/electron-quick-start.git -b webview-problem
  $ npm install
  $ npm start || electron .
</code></pre></div>
<p dir="auto">Start recording a timeline in the dev tools, click <code class="notranslate">Add 10</code> 2-3 times, then <code class="notranslate">Remove All</code>. Manually garbage collect. Stop recording.</p>
<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>7.1.2</li>
</ul>
</li>
<li><strong>Operating System:</strong>
<ul dir="auto">
<li>Windows 10 1909</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong>
<ul dir="auto">
<li>7.x.x (in another Windows 10 1909 computer)</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">The menu that appears below the app title (the one with File, Edit, View...) must dissappear.</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">Nothing. It does nothing. The menu is still there. as if nothing happened.</p>
<h3 dir="auto">To reproduce</h3>
<p dir="auto">This is basically the code I am testing:</p>
<p dir="auto">const { app, BrowserWindow } = require('electron');</p>
<p dir="auto">function createWindow() {<br>
let win = new BrowserWindow({<br>
width: 800,<br>
height: 600,<br>
webPreferences: {<br>
nodeIntegration: true,<br>
}<br>
})<br>
win.setMenuBarVisibility(false);<br>
win.loadFile('./public/index.html')<br>
}</p>
<p dir="auto">app.on('ready', createWindow)</p>
<p dir="auto">Everything works as expected, except the menu, which it still shows.</p>
<h3 dir="auto">Screenshots</h3>
<p dir="auto"><a href="url">https://i.imgur.com/kJJf0JE.png</a></p>